diff options
Diffstat (limited to 'fs/exec.c')
-rw-r--r-- | fs/exec.c | 16 |
1 files changed, 6 insertions, 10 deletions
@@ -1566,12 +1566,11 @@ out_ret: | |||
1566 | 1566 | ||
1567 | int do_execve(const char *filename, | 1567 | int 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 |