aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2012-10-20 21:49:33 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2012-11-28 21:53:37 -0500
commitda3d4c5fa56236dd924d77ffc4f982356816b93b (patch)
tree37cbc90820ef0e5474801db00c968e2da7c455aa
parentd03d26e58fde2ec99478e26aab47b55755189b08 (diff)
get rid of pt_regs argument of do_execve()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r--fs/exec.c16
-rw-r--r--include/linux/sched.h2
-rw-r--r--include/linux/syscalls.h3
3 files changed, 8 insertions, 13 deletions
diff --git a/fs/exec.c b/fs/exec.c
index f86b6cc2d6cc..5797ed07efd3 100644
--- a/fs/exec.c
+++ b/fs/exec.c
@@ -1566,12 +1566,11 @@ out_ret:
1566 1566
1567int do_execve(const char *filename, 1567int do_execve(const char *filename,
1568 const char __user *const __user *__argv, 1568 const char __user *const __user *__argv,
1569 const char __user *const __user *__envp, 1569 const char __user *const __user *__envp)
1570 struct pt_regs *regs)
1571{ 1570{
1572 struct user_arg_ptr argv = { .ptr.native = __argv }; 1571 struct user_arg_ptr argv = { .ptr.native = __argv };
1573 struct user_arg_ptr envp = { .ptr.native = __envp }; 1572 struct user_arg_ptr envp = { .ptr.native = __envp };
1574 return do_execve_common(filename, argv, envp, regs); 1573 return do_execve_common(filename, argv, envp, current_pt_regs());
1575} 1574}
1576 1575
1577#ifdef CONFIG_COMPAT 1576#ifdef CONFIG_COMPAT
@@ -1668,7 +1667,7 @@ SYSCALL_DEFINE3(execve,
1668 struct filename *path = getname(filename); 1667 struct filename *path = getname(filename);
1669 int error = PTR_ERR(path); 1668 int error = PTR_ERR(path);
1670 if (!IS_ERR(path)) { 1669 if (!IS_ERR(path)) {
1671 error = do_execve(path->name, argv, envp, current_pt_regs()); 1670 error = do_execve(path->name, argv, envp);
1672 putname(path); 1671 putname(path);
1673 } 1672 }
1674 return error; 1673 return error;
@@ -1694,12 +1693,9 @@ int kernel_execve(const char *filename,
1694 const char *const argv[], 1693 const char *const argv[],
1695 const char *const envp[]) 1694 const char *const envp[])
1696{ 1695{
1697 struct pt_regs *p = current_pt_regs(); 1696 int ret = do_execve(filename,
1698 int ret;
1699
1700 ret = do_execve(filename,
1701 (const char __user *const __user *)argv, 1697 (const char __user *const __user *)argv,
1702 (const char __user *const __user *)envp, p); 1698 (const char __user *const __user *)envp);
1703 if (ret < 0) 1699 if (ret < 0)
1704 return ret; 1700 return ret;
1705 1701
@@ -1707,6 +1703,6 @@ int kernel_execve(const char *filename,
1707 * We were successful. We won't be returning to our caller, but 1703 * We were successful. We won't be returning to our caller, but
1708 * instead to user space by manipulating the kernel stack. 1704 * instead to user space by manipulating the kernel stack.
1709 */ 1705 */
1710 ret_from_kernel_execve(p); 1706 ret_from_kernel_execve(current_pt_regs());
1711} 1707}
1712#endif 1708#endif
diff --git a/include/linux/sched.h b/include/linux/sched.h
index a0166481eb20..c57249782e48 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -2288,7 +2288,7 @@ extern int disallow_signal(int);
2288 2288
2289extern int do_execve(const char *, 2289extern int do_execve(const char *,
2290 const char __user * const __user *, 2290 const char __user * const __user *,
2291 const char __user * const __user *, struct pt_regs *); 2291 const char __user * const __user *);
2292extern long do_fork(unsigned long, unsigned long, struct pt_regs *, unsigned long, int __user *, int __user *); 2292extern long do_fork(unsigned long, unsigned long, struct pt_regs *, unsigned long, int __user *, int __user *);
2293struct task_struct *fork_idle(int); 2293struct task_struct *fork_idle(int);
2294#ifdef CONFIG_GENERIC_KERNEL_THREAD 2294#ifdef CONFIG_GENERIC_KERNEL_THREAD
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h
index 2779009ceaa3..526deb333b91 100644
--- a/include/linux/syscalls.h
+++ b/include/linux/syscalls.h
@@ -833,8 +833,7 @@ int kernel_execve(const char *filename, const char *const argv[], const char *co
833#define kernel_execve(filename, argv, envp) \ 833#define kernel_execve(filename, argv, envp) \
834 do_execve(filename, \ 834 do_execve(filename, \
835 (const char __user *const __user *)argv, \ 835 (const char __user *const __user *)argv, \
836 (const char __user *const __user *)envp, \ 836 (const char __user *const __user *)envp)
837 current_pt_regs())
838#endif 837#endif
839 838
840asmlinkage long sys_execve(const char __user *filename, 839asmlinkage long sys_execve(const char __user *filename,