From 733deca197143857f938b41d671cd7ce9c53c4bc Mon Sep 17 00:00:00 2001 From: Al Viro Date: Sat, 20 Oct 2012 13:13:11 -0400 Subject: Drop struct pt_regs * argument in compat_sys_execve() Signed-off-by: Al Viro --- arch/tile/include/asm/compat.h | 6 ------ arch/tile/include/asm/processor.h | 3 +++ arch/tile/kernel/compat.c | 1 - arch/tile/kernel/intvec_64.S | 1 - arch/tile/kernel/process.c | 6 +++--- include/linux/compat.h | 2 -- 6 files changed, 6 insertions(+), 13 deletions(-) diff --git a/arch/tile/include/asm/compat.h b/arch/tile/include/asm/compat.h index 3063e6fc8da..3bcf1b94b56 100644 --- a/arch/tile/include/asm/compat.h +++ b/arch/tile/include/asm/compat.h @@ -275,9 +275,6 @@ extern int compat_setup_rt_frame(int sig, struct k_sigaction *ka, struct compat_sigaction; struct compat_siginfo; struct compat_sigaltstack; -long compat_sys_execve(const char __user *path, - compat_uptr_t __user *argv, - compat_uptr_t __user *envp, struct pt_regs *); long compat_sys_rt_sigaction(int sig, struct compat_sigaction __user *act, struct compat_sigaction __user *oact, size_t sigsetsize); @@ -304,9 +301,6 @@ long compat_sys_sched_rr_get_interval(compat_pid_t pid, struct compat_timespec __user *interval); /* These are the intvec_64.S trampolines. */ -long _compat_sys_execve(const char __user *path, - const compat_uptr_t __user *argv, - const compat_uptr_t __user *envp); long _compat_sys_sigaltstack(const struct compat_sigaltstack __user *uss_ptr, struct compat_sigaltstack __user *uoss_ptr); long _compat_sys_rt_sigreturn(void); diff --git a/arch/tile/include/asm/processor.h b/arch/tile/include/asm/processor.h index 8c4dd9ff91e..9a83e531e84 100644 --- a/arch/tile/include/asm/processor.h +++ b/arch/tile/include/asm/processor.h @@ -239,6 +239,9 @@ unsigned long get_wchan(struct task_struct *p); #define KSTK_TOP(task) (task_ksp0(task) - STACK_TOP_DELTA) #define task_pt_regs(task) \ ((struct pt_regs *)(task_ksp0(task) - KSTK_PTREGS_GAP) - 1) +#define current_pt_regs() \ + ((struct pt_regs *)((stack_pointer | (THREAD_SIZE - 1)) - \ + (KSTK_PTREGS_GAP - 1)) - 1) #define task_sp(task) (task_pt_regs(task)->sp) #define task_pc(task) (task_pt_regs(task)->pc) /* Aliases for pc and sp (used in fs/proc/array.c) */ diff --git a/arch/tile/kernel/compat.c b/arch/tile/kernel/compat.c index d67459b9ac2..a8e5a847037 100644 --- a/arch/tile/kernel/compat.c +++ b/arch/tile/kernel/compat.c @@ -103,7 +103,6 @@ long compat_sys_sched_rr_get_interval(compat_pid_t pid, #define compat_sys_readahead sys32_readahead /* Call the trampolines to manage pt_regs where necessary. */ -#define compat_sys_execve _compat_sys_execve #define compat_sys_sigaltstack _compat_sys_sigaltstack #define compat_sys_rt_sigreturn _compat_sys_rt_sigreturn #define sys_clone _sys_clone diff --git a/arch/tile/kernel/intvec_64.S b/arch/tile/kernel/intvec_64.S index 7c06d597ffd..73f6c0a648c 100644 --- a/arch/tile/kernel/intvec_64.S +++ b/arch/tile/kernel/intvec_64.S @@ -1194,7 +1194,6 @@ PTREGS_SYSCALL(sys_execve, r3) PTREGS_SYSCALL(sys_sigaltstack, r2) PTREGS_SYSCALL_SIGRETURN(sys_rt_sigreturn, r0) #ifdef CONFIG_COMPAT -PTREGS_SYSCALL(compat_sys_execve, r3) PTREGS_SYSCALL(compat_sys_sigaltstack, r2) PTREGS_SYSCALL_SIGRETURN(compat_sys_rt_sigreturn, r0) #endif diff --git a/arch/tile/kernel/process.c b/arch/tile/kernel/process.c index 307d010696c..9dc139127f8 100644 --- a/arch/tile/kernel/process.c +++ b/arch/tile/kernel/process.c @@ -614,8 +614,7 @@ out: #ifdef CONFIG_COMPAT long compat_sys_execve(const char __user *path, compat_uptr_t __user *argv, - compat_uptr_t __user *envp, - struct pt_regs *regs) + compat_uptr_t __user *envp) { long error; struct filename *filename; @@ -624,7 +623,8 @@ long compat_sys_execve(const char __user *path, error = PTR_ERR(filename); if (IS_ERR(filename)) goto out; - error = compat_do_execve(filename->name, argv, envp, regs); + error = compat_do_execve(filename->name, argv, envp, + current_pt_regs()); putname(filename); if (error == 0) single_step_execve(); diff --git a/include/linux/compat.h b/include/linux/compat.h index d0ced1011f2..d2db71077d9 100644 --- a/include/linux/compat.h +++ b/include/linux/compat.h @@ -286,10 +286,8 @@ asmlinkage ssize_t compat_sys_pwritev(unsigned long fd, int compat_do_execve(const char *filename, const compat_uptr_t __user *argv, const compat_uptr_t __user *envp, struct pt_regs *regs); -#ifdef __ARCH_WANT_SYS_EXECVE asmlinkage long compat_sys_execve(const char __user *filename, const compat_uptr_t __user *argv, const compat_uptr_t __user *envp); -#endif asmlinkage long compat_sys_select(int n, compat_ulong_t __user *inp, compat_ulong_t __user *outp, compat_ulong_t __user *exp, -- cgit v1.2.3-70-g09d2