diff options
author | Christian Brauner <christian@brauner.io> | 2019-07-14 21:22:05 +0200 |
---|---|---|
committer | Christian Brauner <christian@brauner.io> | 2019-07-15 00:39:48 +0200 |
commit | 05a70a8ec287c4381ee1441ca779deab7bae124d (patch) | |
tree | 64e9f0f0ba779b4c5d3152beba7df21070775e6d /include/uapi/asm-generic/unistd.h | |
parent | arch: mark syscall number 435 reserved for clone3 (diff) | |
download | linux-05a70a8ec287c4381ee1441ca779deab7bae124d.tar.xz linux-05a70a8ec287c4381ee1441ca779deab7bae124d.zip |
unistd: protect clone3 via __ARCH_WANT_SYS_CLONE3
This lets us catch new architectures that implicitly make use of clone3
without setting __ARCH_WANT_SYS_CLONE3.
Failing on missing __ARCH_WANT_SYS_CLONE3 is a good indicator that they
either did not really want this syscall or haven't really thought about
whether it needs special treatment and just accidently included it in
their entrypoints by e.g. generating their syscall table automatically
via asm-generic/unistd.h
This patch has been compile-tested for the h8300 architecture which is
one of the architectures that does not yet implement clone3 and
generates its syscall table via asm-generic/unistd.h.
Signed-off-by: Christian Brauner <christian@brauner.io>
Suggested-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/20190714192205.27190-3-christian@brauner.io
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Christian Brauner <christian@brauner.io>
Diffstat (limited to 'include/uapi/asm-generic/unistd.h')
-rw-r--r-- | include/uapi/asm-generic/unistd.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/uapi/asm-generic/unistd.h b/include/uapi/asm-generic/unistd.h index 9acfff0cd153..1be0e798e362 100644 --- a/include/uapi/asm-generic/unistd.h +++ b/include/uapi/asm-generic/unistd.h @@ -846,8 +846,10 @@ __SYSCALL(__NR_fsmount, sys_fsmount) __SYSCALL(__NR_fspick, sys_fspick) #define __NR_pidfd_open 434 __SYSCALL(__NR_pidfd_open, sys_pidfd_open) +#ifdef __ARCH_WANT_SYS_CLONE3 #define __NR_clone3 435 __SYSCALL(__NR_clone3, sys_clone3) +#endif #undef __NR_syscalls #define __NR_syscalls 436 |