syscalls: implement execveat() system call
This patchset adds execveat(2) for x86, and is derived from Meredydd Luff's patch from Sept 2012 (https://lkml.org/lkml/2012/9/11/528). The primary aim of adding an execveat syscall is to allow an implementation of fexecve(3) that does not rely on the /proc filesystem, at least for executables (rather than scripts). The current glibc version of fexecve(3) is implemented via /proc, which causes problems in sandboxed or otherwise restricted environments. Given the desire for a /proc-free fexecve() implementation, HPA suggested (https://lkml.org/lkml/2006/7/11/556) that an execveat(2) syscall would be an appropriate generalization. Also, having a new syscall means that it can take a flags argument without back-compatibility concerns. The current implementation just defines the AT_EMPTY_PATH and AT_SYMLINK_NOFOLLOW flags, but other flags could be added in future -- for example, flags for new namespaces (as suggested at https://lkml.org/lkml/2006/7/11/474). Rela...
Showing
- fs/binfmt_em86.c 4 additions, 0 deletionsfs/binfmt_em86.c
- fs/binfmt_misc.c 4 additions, 0 deletionsfs/binfmt_misc.c
- fs/binfmt_script.c 10 additions, 0 deletionsfs/binfmt_script.c
- fs/exec.c 100 additions, 13 deletionsfs/exec.c
- fs/namei.c 1 addition, 1 deletionfs/namei.c
- include/linux/binfmts.h 4 additions, 0 deletionsinclude/linux/binfmts.h
- include/linux/compat.h 3 additions, 0 deletionsinclude/linux/compat.h
- include/linux/fs.h 1 addition, 0 deletionsinclude/linux/fs.h
- include/linux/sched.h 4 additions, 0 deletionsinclude/linux/sched.h
- include/linux/syscalls.h 5 additions, 0 deletionsinclude/linux/syscalls.h
- include/uapi/asm-generic/unistd.h 3 additions, 1 deletioninclude/uapi/asm-generic/unistd.h
- kernel/sys_ni.c 3 additions, 0 deletionskernel/sys_ni.c
- lib/audit.c 3 additions, 0 deletionslib/audit.c
Please register or sign in to comment