diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2012-10-10 21:28:25 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2012-10-12 13:35:07 -0400 |
commit | a74fb73c12398b250fdc5e333a11e15a9e3a84fc (patch) | |
tree | 2bec2f6e20320f5a4bc01d1e19d7190842ef1c37 /include/linux/syscalls.h | |
parent | fb45550d76bb584857cf0ea3be79fa78207a3cff (diff) |
infrastructure for saner ret_from_kernel_thread semantics
* allow kernel_execve() leave the actual return to userland to
caller (selected by CONFIG_GENERIC_KERNEL_EXECVE). Callers
updated accordingly.
* architecture that does select GENERIC_KERNEL_EXECVE in its
Kconfig should have its ret_from_kernel_thread() do this:
call schedule_tail
call the callback left for it by copy_thread(); if it ever
returns, that's because it has just done successful kernel_execve()
jump to return from syscall
IOW, its only difference from ret_from_fork() is that it does call the
callback.
* such an architecture should also get rid of ret_from_kernel_execve()
and __ARCH_WANT_KERNEL_EXECVE
This is the last part of infrastructure patches in that area - from
that point on work on different architectures can live independently.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'include/linux/syscalls.h')
-rw-r--r-- | include/linux/syscalls.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h index 19439c75c5b2..727f0cd73921 100644 --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h | |||
@@ -827,7 +827,15 @@ asmlinkage long sys_fanotify_mark(int fanotify_fd, unsigned int flags, | |||
827 | const char __user *pathname); | 827 | const char __user *pathname); |
828 | asmlinkage long sys_syncfs(int fd); | 828 | asmlinkage long sys_syncfs(int fd); |
829 | 829 | ||
830 | #ifndef CONFIG_GENERIC_KERNEL_EXECVE | ||
830 | int kernel_execve(const char *filename, const char *const argv[], const char *const envp[]); | 831 | int kernel_execve(const char *filename, const char *const argv[], const char *const envp[]); |
832 | #else | ||
833 | #define kernel_execve(filename, argv, envp) \ | ||
834 | do_execve(filename, \ | ||
835 | (const char __user *const __user *)argv, \ | ||
836 | (const char __user *const __user *)envp, \ | ||
837 | current_pt_regs()) | ||
838 | #endif | ||
831 | 839 | ||
832 | 840 | ||
833 | asmlinkage long sys_perf_event_open( | 841 | asmlinkage long sys_perf_event_open( |