# git rev-parse -q --verify 642e7fd23353e22290e3d51719fcb658dc252342^{commit} 642e7fd23353e22290e3d51719fcb658dc252342 already have revision, skipping fetch # git checkout -q -f -B kisskb 642e7fd23353e22290e3d51719fcb658dc252342 # git clean -qxdf # < git log -1 # commit 642e7fd23353e22290e3d51719fcb658dc252342 # Merge: 2103596 c9a2119 # Author: Linus Torvalds # Date: Mon Apr 2 21:22:12 2018 -0700 # # Merge branch 'syscalls-next' of git://git.kernel.org/pub/scm/linux/kernel/git/brodo/linux # # Pull removal of in-kernel calls to syscalls from Dominik Brodowski: # "System calls are interaction points between userspace and the kernel. # Therefore, system call functions such as sys_xyzzy() or # compat_sys_xyzzy() should only be called from userspace via the # syscall table, but not from elsewhere in the kernel. # # At least on 64-bit x86, it will likely be a hard requirement from # v4.17 onwards to not call system call functions in the kernel: It is # better to use use a different calling convention for system calls # there, where struct pt_regs is decoded on-the-fly in a syscall wrapper # which then hands processing over to the actual syscall function. This # means that only those parameters which are actually needed for a # specific syscall are passed on during syscall entry, instead of # filling in six CPU registers with random user space content all the # time (which may cause serious trouble down the call chain). Those # x86-specific patches will be pushed through the x86 tree in the near # future. # # Moreover, rules on how data may be accessed may differ between kernel # data and user data. This is another reason why calling sys_xyzzy() is # generally a bad idea, and -- at most -- acceptable in arch-specific # code. # # This patchset removes all in-kernel calls to syscall functions in the # kernel with the exception of arch/. On top of this, it cleans up the # three places where many syscalls are referenced or prototyped, namely # kernel/sys_ni.c, include/linux/syscalls.h and include/linux/compat.h" # # * 'syscalls-next' of git://git.kernel.org/pub/scm/linux/kernel/git/brodo/linux: (109 commits) # bpf: whitelist all syscalls for error injection # kernel/sys_ni: remove {sys_,sys_compat} from cond_syscall definitions # kernel/sys_ni: sort cond_syscall() entries # syscalls/x86: auto-create compat_sys_*() prototypes # syscalls: sort syscall prototypes in include/linux/compat.h # net: remove compat_sys_*() prototypes from net/compat.h # syscalls: sort syscall prototypes in include/linux/syscalls.h # kexec: move sys_kexec_load() prototype to syscalls.h # x86/sigreturn: use SYSCALL_DEFINE0 # x86: fix sys_sigreturn() return type to be long, not unsigned long # x86/ioport: add ksys_ioperm() helper; remove in-kernel calls to sys_ioperm() # mm: add ksys_readahead() helper; remove in-kernel calls to sys_readahead() # mm: add ksys_mmap_pgoff() helper; remove in-kernel calls to sys_mmap_pgoff() # mm: add ksys_fadvise64_64() helper; remove in-kernel call to sys_fadvise64_64() # fs: add ksys_fallocate() wrapper; remove in-kernel calls to sys_fallocate() # fs: add ksys_p{read,write}64() helpers; remove in-kernel calls to syscalls # fs: add ksys_truncate() wrapper; remove in-kernel calls to sys_truncate() # fs: add ksys_sync_file_range helper(); remove in-kernel calls to syscall # kernel: add ksys_setsid() helper; remove in-kernel call to sys_setsid() # kernel: add ksys_unshare() helper; remove in-kernel calls to sys_unshare() # ... # < /opt/cross/kisskb/gcc-4.6.3-nolibc/sh4-linux/bin/sh4-linux-gcc --version # < git log --format=%s --max-count=1 642e7fd23353e22290e3d51719fcb658dc252342 # < make -s -j 10 ARCH=sh O=/kisskb/build/linus_sh-randconfig_sh4 CROSS_COMPILE=/opt/cross/kisskb/gcc-4.6.3-nolibc/sh4-linux/bin/sh4-linux- randconfig KCONFIG_SEED=0xFF98AB00 # Added to kconfig CONFIG_STANDALONE=y # yes \n | make -s -j 10 ARCH=sh O=/kisskb/build/linus_sh-randconfig_sh4 CROSS_COMPILE=/opt/cross/kisskb/gcc-4.6.3-nolibc/sh4-linux/bin/sh4-linux- oldconfig yes: standard output: Broken pipe yes: write error # make -s -j 10 ARCH=sh O=/kisskb/build/linus_sh-randconfig_sh4 CROSS_COMPILE=/opt/cross/kisskb/gcc-4.6.3-nolibc/sh4-linux/bin/sh4-linux- Generating include/generated/machtypes.h :1317:2: warning: #warning syscall pkey_mprotect not implemented [-Wcpp] :1320:2: warning: #warning syscall pkey_alloc not implemented [-Wcpp] :1323:2: warning: #warning syscall pkey_free not implemented [-Wcpp] :1326:2: warning: #warning syscall statx not implemented [-Wcpp] In file included from /kisskb/src/arch/sh/math-emu/math.c:23:0: /kisskb/src/include/math-emu/single.h:50:21: warning: "__BIG_ENDIAN" is not defined [-Wundef] In file included from /kisskb/src/arch/sh/math-emu/math.c:24:0: /kisskb/src/include/math-emu/double.h:59:21: warning: "__BIG_ENDIAN" is not defined [-Wundef] /kisskb/src/arch/sh/math-emu/math.c:54:0: warning: "WRITE" redefined [enabled by default] /kisskb/src/include/linux/kernel.h:65:0: note: this is the location of the previous definition /kisskb/src/arch/sh/math-emu/math.c:55:0: warning: "READ" redefined [enabled by default] /kisskb/src/include/linux/kernel.h:64:0: note: this is the location of the previous definition /kisskb/src/arch/sh/math-emu/math.c: In function 'fcmp_gt': /kisskb/src/arch/sh/math-emu/math.c:81:1: warning: left shift count is negative [enabled by default] /kisskb/src/arch/sh/math-emu/math.c:81:1: warning: left shift count is negative [enabled by default] /kisskb/src/arch/sh/math-emu/math.c: In function 'fcmp_eq': /kisskb/src/arch/sh/math-emu/math.c:92:1: warning: left shift count is negative [enabled by default] /kisskb/src/arch/sh/math-emu/math.c:92:1: warning: left shift count is negative [enabled by default] /kisskb/src/arch/sh/math-emu/math.c: In function 'fadd': /kisskb/src/arch/sh/math-emu/math.c:108:1: warning: left shift count is negative [enabled by default] /kisskb/src/arch/sh/math-emu/math.c:108:1: warning: left shift count is negative [enabled by default] /kisskb/src/arch/sh/math-emu/math.c:108:1: warning: right shift count is negative [enabled by default] /kisskb/src/arch/sh/math-emu/math.c:108:1: warning: left shift count >= width of type [enabled by default] /kisskb/src/arch/sh/math-emu/math.c:108:1: warning: statement with no effect [-Wunused-value] /kisskb/src/arch/sh/math-emu/math.c:108:1: warning: right shift count is negative [enabled by default] /kisskb/src/arch/sh/math-emu/math.c:108:1: warning: statement with no effect [-Wunused-value] /kisskb/src/arch/sh/math-emu/math.c:108:1: warning: right shift count is negative [enabled by default] /kisskb/src/arch/sh/math-emu/math.c:108:1: warning: statement with no effect [-Wunused-value] /kisskb/src/arch/sh/math-emu/math.c:108:1: warning: statement with no effect [-Wunused-value] /kisskb/src/arch/sh/math-emu/math.c:108:1: warning: statement with no effect [-Wunused-value] /kisskb/src/arch/sh/math-emu/math.c:108:1: warning: statement with no effect [-Wunused-value] /kisskb/src/arch/sh/math-emu/math.c: In function 'fsub': /kisskb/src/arch/sh/math-emu/math.c:115:1: warning: left shift count is negative [enabled by default] /kisskb/src/arch/sh/math-emu/math.c:115:1: warning: left shift count is negative [enabled by default] /kisskb/src/arch/sh/math-emu/math.c:115:1: warning: right shift count is negative [enabled by default] /kisskb/src/arch/sh/math-emu/math.c:115:1: warning: left shift count >= width of type [enabled by default] /kisskb/src/arch/sh/math-emu/math.c:115:1: warning: statement with no effect [-Wunused-value] /kisskb/src/arch/sh/math-emu/math.c:115:1: warning: right shift count is negative [enabled by default] /kisskb/src/arch/sh/math-emu/math.c:115:1: warning: statement with no effect [-Wunused-value] /kisskb/src/arch/sh/math-emu/math.c:115:1: warning: right shift count is negative [enabled by default] /kisskb/src/arch/sh/math-emu/math.c:115:1: warning: statement with no effect [-Wunused-value] /kisskb/src/arch/sh/math-emu/math.c:115:1: warning: statement with no effect [-Wunused-value] /kisskb/src/arch/sh/math-emu/math.c:115:1: warning: statement with no effect [-Wunused-value] /kisskb/src/arch/sh/math-emu/math.c:115:1: warning: statement with no effect [-Wunused-value] /kisskb/src/arch/sh/math-emu/math.c: In function 'fmul': /kisskb/src/arch/sh/math-emu/math.c:122:1: warning: left shift count is negative [enabled by default] /kisskb/src/arch/sh/math-emu/math.c:122:1: warning: left shift count is negative [enabled by default] /kisskb/src/arch/sh/math-emu/math.c:122:1: warning: right shift count is negative [enabled by default] /kisskb/src/arch/sh/math-emu/math.c:122:1: warning: left shift count >= width of type [enabled by default] /kisskb/src/arch/sh/math-emu/math.c:122:1: warning: statement with no effect [-Wunused-value] /kisskb/src/arch/sh/math-emu/math.c:122:1: warning: right shift count is negative [enabled by default] /kisskb/src/arch/sh/math-emu/math.c:122:1: warning: statement with no effect [-Wunused-value] /kisskb/src/arch/sh/math-emu/math.c:122:1: warning: right shift count is negative [enabled by default] /kisskb/src/arch/sh/math-emu/math.c:122:1: warning: statement with no effect [-Wunused-value] /kisskb/src/arch/sh/math-emu/math.c:122:1: warning: right shift count is negative [enabled by default] /kisskb/src/arch/sh/math-emu/math.c:122:1: warning: left shift count >= width of type [enabled by default] /kisskb/src/arch/sh/math-emu/math.c:122:1: warning: statement with no effect [-Wunused-value] /kisskb/src/arch/sh/math-emu/math.c:122:1: warning: statement with no effect [-Wunused-value] /kisskb/src/arch/sh/math-emu/math.c:122:1: warning: statement with no effect [-Wunused-value] /kisskb/src/arch/sh/math-emu/math.c: In function 'fdiv': /kisskb/src/arch/sh/math-emu/math.c:129:1: warning: left shift count is negative [enabled by default] /kisskb/src/arch/sh/math-emu/math.c:129:1: warning: left shift count is negative [enabled by default] /kisskb/src/arch/sh/math-emu/math.c:129:1: warning: left shift count is negative [enabled by default] /kisskb/src/arch/sh/math-emu/math.c:129:1: warning: statement with no effect [-Wunused-value] /kisskb/src/arch/sh/math-emu/math.c:129:1: warning: right shift count is negative [enabled by default] /kisskb/src/arch/sh/math-emu/math.c:129:1: warning: statement with no effect [-Wunused-value] /kisskb/src/arch/sh/math-emu/math.c:129:1: warning: right shift count is negative [enabled by default] /kisskb/src/arch/sh/math-emu/math.c:129:1: warning: statement with no effect [-Wunused-value] /kisskb/src/arch/sh/math-emu/math.c:129:1: warning: statement with no effect [-Wunused-value] /kisskb/src/arch/sh/math-emu/math.c:129:1: warning: statement with no effect [-Wunused-value] /kisskb/src/arch/sh/math-emu/math.c:129:1: warning: statement with no effect [-Wunused-value] /kisskb/src/arch/sh/math-emu/math.c: In function 'fmac': /kisskb/src/arch/sh/math-emu/math.c:145:2: warning: right shift count is negative [enabled by default] /kisskb/src/arch/sh/math-emu/math.c:145:2: warning: left shift count >= width of type [enabled by default] /kisskb/src/arch/sh/math-emu/math.c:147:1: warning: statement with no effect [-Wunused-value] /kisskb/src/arch/sh/math-emu/math.c:147:1: warning: statement with no effect [-Wunused-value] /kisskb/src/arch/sh/math-emu/math.c:147:1: warning: statement with no effect [-Wunused-value] /kisskb/src/arch/sh/math-emu/math.c: In function 'ffloat': /kisskb/src/arch/sh/math-emu/math.c:294:3: warning: right shift count >= width of type [enabled by default] /kisskb/src/arch/sh/math-emu/math.c:294:3: warning: right shift count >= width of type [enabled by default] /kisskb/src/arch/sh/math-emu/math.c:294:1: warning: statement with no effect [-Wunused-value] /kisskb/src/arch/sh/math-emu/math.c:294:3: warning: right shift count is negative [enabled by default] /kisskb/src/arch/sh/math-emu/math.c:294:1: warning: statement with no effect [-Wunused-value] /kisskb/src/arch/sh/math-emu/math.c:294:3: warning: right shift count is negative [enabled by default] /kisskb/src/arch/sh/math-emu/math.c:294:1: warning: statement with no effect [-Wunused-value] /kisskb/src/arch/sh/math-emu/math.c:296:3: warning: right shift count >= width of type [enabled by default] /kisskb/src/arch/sh/math-emu/math.c:296:3: warning: right shift count >= width of type [enabled by default] /kisskb/src/arch/sh/math-emu/math.c:296:1: warning: statement with no effect [-Wunused-value] /kisskb/src/arch/sh/math-emu/math.c:296:1: warning: statement with no effect [-Wunused-value] /kisskb/src/arch/sh/math-emu/math.c:296:1: warning: statement with no effect [-Wunused-value] /kisskb/src/arch/sh/math-emu/math.c: In function 'ftrc': /kisskb/src/arch/sh/math-emu/math.c:310:1: warning: left shift count is negative [enabled by default] /kisskb/src/arch/sh/math-emu/math.c:310:1: warning: left shift count >= width of type [enabled by default] /kisskb/src/arch/sh/math-emu/math.c:310:1: warning: left shift count >= width of type [enabled by default] /kisskb/src/arch/sh/math-emu/math.c:310:1: warning: right shift count is negative [enabled by default] /kisskb/src/arch/sh/math-emu/math.c:310:1: warning: left shift count >= width of type [enabled by default] /kisskb/src/arch/sh/math-emu/math.c: In function 'fcnvsd': /kisskb/src/arch/sh/math-emu/math.c:323:2: warning: left shift count is negative [enabled by default] /kisskb/src/arch/sh/math-emu/math.c:324:1: warning: statement with no effect [-Wunused-value] /kisskb/src/arch/sh/math-emu/math.c:324:2: warning: right shift count is negative [enabled by default] /kisskb/src/arch/sh/math-emu/math.c:324:1: warning: statement with no effect [-Wunused-value] /kisskb/src/arch/sh/math-emu/math.c:324:2: warning: right shift count is negative [enabled by default] /kisskb/src/arch/sh/math-emu/math.c:324:1: warning: statement with no effect [-Wunused-value] /kisskb/src/arch/sh/math-emu/math.c: In function 'fcnvds': /kisskb/src/arch/sh/math-emu/math.c:333:1: warning: left shift count is negative [enabled by default] /kisskb/src/arch/sh/math-emu/math.c:334:2: warning: right shift count is negative [enabled by default] /kisskb/src/arch/sh/math-emu/math.c:334:2: warning: left shift count >= width of type [enabled by default] /kisskb/src/arch/sh/math-emu/math.c:334:2: warning: right shift count is negative [enabled by default] /kisskb/src/arch/sh/math-emu/math.c:335:1: warning: statement with no effect [-Wunused-value] /kisskb/src/arch/sh/math-emu/math.c:335:1: warning: statement with no effect [-Wunused-value] /kisskb/src/arch/sh/math-emu/math.c:335:1: warning: statement with no effect [-Wunused-value] /kisskb/src/arch/sh/math-emu/math.c: At top level: /kisskb/src/arch/sh/math-emu/math.c:505:12: warning: 'ieee_fpe_handler' defined but not used [-Wunused-function] /kisskb/src/arch/sh/kernel/cpu/sh2/probe.c: In function 'scan_cache': /kisskb/src/arch/sh/kernel/cpu/sh2/probe.c:27:16: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] /kisskb/src/arch/sh/kernel/cpu/sh2/probe.c: In function 'cpu_probe': /kisskb/src/arch/sh/kernel/cpu/sh2/probe.c:46:2: error: implicit declaration of function 'hard_smp_processor_id' [-Werror=implicit-function-declaration] cc1: some warnings being treated as errors /kisskb/src/scripts/Makefile.build:324: recipe for target 'arch/sh/kernel/cpu/sh2/probe.o' failed make[4]: *** [arch/sh/kernel/cpu/sh2/probe.o] Error 1 /kisskb/src/scripts/Makefile.build:583: recipe for target 'arch/sh/kernel/cpu/sh2' failed make[3]: *** [arch/sh/kernel/cpu/sh2] Error 2 /kisskb/src/scripts/Makefile.build:583: recipe for target 'arch/sh/kernel/cpu' failed make[2]: *** [arch/sh/kernel/cpu] Error 2 make[2]: *** Waiting for unfinished jobs.... /kisskb/src/Makefile:1053: recipe for target 'arch/sh/kernel' failed make[1]: *** [arch/sh/kernel] Error 2 make[1]: *** Waiting for unfinished jobs.... /kisskb/src/kernel/cgroup/cgroup-v1.c: In function 'cgroup1_mount': /kisskb/src/kernel/cgroup/cgroup-v1.c:1268:20: warning: 'root' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/drivers/dma-buf/reservation.c: In function 'reservation_object_add_shared_fence': /kisskb/src/drivers/dma-buf/reservation.c:225:6: warning: 'k' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/kernel/printk/printk.c: In function 'devkmsg_sysctl_set_loglvl': /kisskb/src/kernel/printk/printk.c:183:16: warning: 'old' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/kernel/rcu/srcutree.c: In function 'init_srcu_struct_fields': /kisskb/src/kernel/rcu/srcutree.c:127:33: warning: 'levelspread[]' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/kernel/rcu/srcutree.c:94:6: note: 'levelspread[]' was declared here /kisskb/src/drivers/input/joystick/analog.c:176:2: warning: #warning Precise timer not defined for this architecture. [-Wcpp] /kisskb/src/drivers/mfd/arizona-core.c: In function 'arizona_dev_init': /kisskb/src/drivers/mfd/arizona-core.c:1387:6: warning: 'n_subdevs' may be used uninitialized in this function [-Wuninitialized] /kisskb/src/drivers/mfd/htc-pasic3.c: In function 'pasic3_remove': /kisskb/src/drivers/mfd/htc-pasic3.c:189:22: warning: unused variable 'asic' [-Wunused-variable] /kisskb/src/drivers/net/arcnet/arc-rimi.c: In function 'arc_rimi_exit': /kisskb/src/drivers/net/arcnet/arc-rimi.c:346:23: warning: unused variable 'lp' [-Wunused-variable] /kisskb/src/drivers/sh/clk/cpg.c: In function 'r8': /kisskb/src/drivers/sh/clk/cpg.c:41:2: warning: passing argument 1 of 'ioread8' discards 'const' qualifier from pointer target type [enabled by default] /kisskb/src/include/asm-generic/iomap.h:29:21: note: expected 'void *' but argument is of type 'const void *' /kisskb/src/drivers/sh/clk/cpg.c: In function 'r16': /kisskb/src/drivers/sh/clk/cpg.c:46:2: warning: passing argument 1 of 'ioread16' discards 'const' qualifier from pointer target type [enabled by default] /kisskb/src/include/asm-generic/iomap.h:30:21: note: expected 'void *' but argument is of type 'const void *' /kisskb/src/drivers/sh/clk/cpg.c: In function 'r32': /kisskb/src/drivers/sh/clk/cpg.c:51:2: warning: passing argument 1 of 'ioread32' discards 'const' qualifier from pointer target type [enabled by default] /kisskb/src/include/asm-generic/iomap.h:32:21: note: expected 'void *' but argument is of type 'const void *' /kisskb/src/drivers/thermal/broadcom/ns-thermal.c: In function 'ns_thermal_remove': /kisskb/src/drivers/thermal/broadcom/ns-thermal.c:81:21: warning: unused variable 'ns_thermal' [-Wunused-variable] Makefile:146: recipe for target 'sub-make' failed make: *** [sub-make] Error 2 Command 'make -s -j 10 ARCH=sh O=/kisskb/build/linus_sh-randconfig_sh4 CROSS_COMPILE=/opt/cross/kisskb/gcc-4.6.3-nolibc/sh4-linux/bin/sh4-linux- ' returned non-zero exit status 2 # rm -rf /kisskb/build/linus_sh-randconfig_sh4 # Build took: 0:01:05.863043