# 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/br-xtensa-full-2016.08-613-ge98b4dd/bin/xtensa-linux-gcc --version # < git log --format=%s --max-count=1 642e7fd23353e22290e3d51719fcb658dc252342 # < make -s -j 10 ARCH=xtensa O=/kisskb/build/linus_xtensa-allmodconfig_xtensa CROSS_COMPILE=/opt/cross/kisskb/br-xtensa-full-2016.08-613-ge98b4dd/bin/xtensa-linux- allmodconfig # Added to kconfig CONFIG_BUILD_DOCSRC=n # Added to kconfig CONFIG_MODULE_SIG=n # Added to kconfig CONFIG_SAMPLES=n # yes \n | make -s -j 10 ARCH=xtensa O=/kisskb/build/linus_xtensa-allmodconfig_xtensa CROSS_COMPILE=/opt/cross/kisskb/br-xtensa-full-2016.08-613-ge98b4dd/bin/xtensa-linux- oldconfig yes: standard output: Broken pipe yes: write error # make -s -j 10 ARCH=xtensa O=/kisskb/build/linus_xtensa-allmodconfig_xtensa CROSS_COMPILE=/opt/cross/kisskb/br-xtensa-full-2016.08-613-ge98b4dd/bin/xtensa-linux- CONFIG_CC_STACKPROTECTOR_AUTO: Compiler does not support any known stack-protector In file included from /kisskb/src/include/linux/interrupt.h:6:0, from /kisskb/src/mm/kasan/kasan.c:20: /kisskb/src/mm/kasan/kasan.c: In function 'kasan_cache_create': /kisskb/src/include/linux/kernel.h:793:16: warning: comparison of distinct pointer types lacks a cast (void) (&min1 == &min2); \ ^ /kisskb/src/include/linux/kernel.h:802:2: note: in expansion of macro '__min' __min(typeof(x), typeof(y), \ ^ /kisskb/src/mm/kasan/kasan.c:361:10: note: in expansion of macro 'min' *size = min(KMALLOC_MAX_SIZE, max(*size, cache->object_size + ^ /kisskb/src/drivers/char/tpm/tpm2-cmd.c: In function 'tpm2_unseal_trusted': /kisskb/src/drivers/char/tpm/tpm2-cmd.c:733:2: warning: 'blob_handle' may be used uninitialized in this function [-Wmaybe-uninitialized] tpm2_flush_context_cmd(chip, blob_handle, TPM_TRANSMIT_UNLOCKED); ^ /kisskb/src/lib/test_kasan.c: In function 'use_after_scope_test': /kisskb/src/lib/test_kasan.c:504:1: warning: the frame size of 1040 bytes is larger than 1024 bytes [-Wframe-larger-than=] } ^ /kisskb/src/drivers/input/joystick/analog.c:176:2: warning: #warning Precise timer not defined for this architecture. [-Wcpp] #warning Precise timer not defined for this architecture. ^ In file included from /kisskb/src/arch/xtensa/include/asm/atomic.h:21:0, from /kisskb/src/include/linux/atomic.h:5, from /kisskb/src/include/linux/debug_locks.h:6, from /kisskb/src/include/linux/lockdep.h:28, from /kisskb/src/include/linux/spinlock_types.h:18, from /kisskb/src/include/linux/spinlock.h:82, from /kisskb/src/include/linux/wait.h:9, from /kisskb/src/include/linux/wait_bit.h:8, from /kisskb/src/include/linux/fs.h:6, from /kisskb/src/fs/ocfs2/file.c:27: /kisskb/src/fs/ocfs2/file.c: In function 'ocfs2_file_write_iter': /kisskb/src/arch/xtensa/include/asm/cmpxchg.h:139:3: warning: value computed is not used [-Wunused-value] ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr)))) ^ /kisskb/src/fs/ocfs2/file.c:2386:3: note: in expansion of macro 'xchg' xchg(&iocb->ki_complete, saved_ki_complete); ^ /kisskb/src/drivers/net/usb/rtl8150.c:30:0: warning: "RSR" redefined #define RSR 0x0133 ^ In file included from /kisskb/src/arch/xtensa/include/asm/bitops.h:22:0, from /kisskb/src/include/linux/bitops.h:38, from /kisskb/src/include/linux/kernel.h:11, from /kisskb/src/include/asm-generic/bug.h:18, from ./arch/xtensa/include/generated/asm/bug.h:1, from /kisskb/src/include/linux/bug.h:5, from /kisskb/src/include/linux/signal.h:5, from /kisskb/src/drivers/net/usb/rtl8150.c:9: /kisskb/src/arch/xtensa/include/asm/processor.h:221:0: note: this is the location of the previous definition #define RSR(v,sr) __asm__ __volatile__ ("rsr %0,"__stringify(sr) : "=a"(v)); ^ In file included from /kisskb/src/arch/xtensa/include/asm/atomic.h:21:0, from /kisskb/src/include/linux/atomic.h:5, from /kisskb/src/include/linux/debug_locks.h:6, from /kisskb/src/include/linux/lockdep.h:28, from /kisskb/src/include/linux/spinlock_types.h:18, from /kisskb/src/include/linux/spinlock.h:82, from /kisskb/src/include/linux/seqlock.h:36, from /kisskb/src/include/linux/time.h:6, from /kisskb/src/include/linux/stat.h:19, from /kisskb/src/include/linux/module.h:10, from /kisskb/src/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c:30: /kisskb/src/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c: In function 'ixgbe_xdp_setup': /kisskb/src/arch/xtensa/include/asm/cmpxchg.h:139:3: warning: value computed is not used [-Wunused-value] ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr)))) ^ /kisskb/src/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c:9957:4: note: in expansion of macro 'xchg' xchg(&adapter->rx_ring[i]->xdp_prog, adapter->xdp_prog); ^ In file included from /kisskb/src/drivers/scsi/sym53c8xx_2/sym_glue.h:64:0, from /kisskb/src/drivers/scsi/sym53c8xx_2/sym_fw.c:40: /kisskb/src/drivers/scsi/sym53c8xx_2/sym_defs.h:109:0: warning: "WSR" redefined #define WSR 0x01 /* sta: wide scsi received [W]*/ ^ In file included from /kisskb/src/arch/xtensa/include/asm/bitops.h:22:0, from /kisskb/src/include/linux/bitops.h:38, from /kisskb/src/include/linux/kernel.h:11, from /kisskb/src/include/linux/list.h:9, from /kisskb/src/include/linux/wait.h:7, from /kisskb/src/include/linux/completion.h:12, from /kisskb/src/drivers/scsi/sym53c8xx_2/sym_glue.h:43, from /kisskb/src/drivers/scsi/sym53c8xx_2/sym_fw.c:40: /kisskb/src/arch/xtensa/include/asm/processor.h:220:0: note: this is the location of the previous definition #define WSR(v,sr) __asm__ __volatile__ ("wsr %0,"__stringify(sr) :: "a"(v)); ^ In file included from /kisskb/src/drivers/scsi/sym53c8xx_2/sym_glue.h:64:0, from /kisskb/src/drivers/scsi/sym53c8xx_2/sym_glue.c:50: /kisskb/src/drivers/scsi/sym53c8xx_2/sym_defs.h:109:0: warning: "WSR" redefined #define WSR 0x01 /* sta: wide scsi received [W]*/ ^ In file included from /kisskb/src/arch/xtensa/include/asm/bitops.h:22:0, from /kisskb/src/include/linux/bitops.h:38, from /kisskb/src/include/linux/kernel.h:11, from /kisskb/src/include/linux/list.h:9, from /kisskb/src/include/linux/module.h:9, from /kisskb/src/drivers/scsi/sym53c8xx_2/sym_glue.c:42: /kisskb/src/arch/xtensa/include/asm/processor.h:220:0: note: this is the location of the previous definition #define WSR(v,sr) __asm__ __volatile__ ("wsr %0,"__stringify(sr) :: "a"(v)); ^ In file included from /kisskb/src/drivers/scsi/sym53c8xx_2/sym_glue.h:64:0, from /kisskb/src/drivers/scsi/sym53c8xx_2/sym_hipd.c:44: /kisskb/src/drivers/scsi/sym53c8xx_2/sym_defs.h:109:0: warning: "WSR" redefined #define WSR 0x01 /* sta: wide scsi received [W]*/ ^ In file included from /kisskb/src/arch/xtensa/include/asm/bitops.h:22:0, from /kisskb/src/include/linux/bitops.h:38, from /kisskb/src/include/linux/kernel.h:11, from /kisskb/src/include/asm-generic/bug.h:18, from ./arch/xtensa/include/generated/asm/bug.h:1, from /kisskb/src/include/linux/bug.h:5, from /kisskb/src/include/linux/mmdebug.h:5, from /kisskb/src/include/linux/gfp.h:5, from /kisskb/src/include/linux/slab.h:15, from /kisskb/src/drivers/scsi/sym53c8xx_2/sym_hipd.c:41: /kisskb/src/arch/xtensa/include/asm/processor.h:220:0: note: this is the location of the previous definition #define WSR(v,sr) __asm__ __volatile__ ("wsr %0,"__stringify(sr) :: "a"(v)); ^ In file included from /kisskb/src/drivers/scsi/sym53c8xx_2/sym_glue.h:64:0, from /kisskb/src/drivers/scsi/sym53c8xx_2/sym_malloc.c:40: /kisskb/src/drivers/scsi/sym53c8xx_2/sym_defs.h:109:0: warning: "WSR" redefined #define WSR 0x01 /* sta: wide scsi received [W]*/ ^ In file included from /kisskb/src/arch/xtensa/include/asm/bitops.h:22:0, from /kisskb/src/include/linux/bitops.h:38, from /kisskb/src/include/linux/kernel.h:11, from /kisskb/src/include/linux/list.h:9, from /kisskb/src/include/linux/wait.h:7, from /kisskb/src/include/linux/completion.h:12, from /kisskb/src/drivers/scsi/sym53c8xx_2/sym_glue.h:43, from /kisskb/src/drivers/scsi/sym53c8xx_2/sym_malloc.c:40: /kisskb/src/arch/xtensa/include/asm/processor.h:220:0: note: this is the location of the previous definition #define WSR(v,sr) __asm__ __volatile__ ("wsr %0,"__stringify(sr) :: "a"(v)); ^ In file included from /kisskb/src/drivers/scsi/sym53c8xx_2/sym_glue.h:64:0, from /kisskb/src/drivers/scsi/sym53c8xx_2/sym_nvram.c:40: /kisskb/src/drivers/scsi/sym53c8xx_2/sym_defs.h:109:0: warning: "WSR" redefined #define WSR 0x01 /* sta: wide scsi received [W]*/ ^ In file included from /kisskb/src/arch/xtensa/include/asm/bitops.h:22:0, from /kisskb/src/include/linux/bitops.h:38, from /kisskb/src/include/linux/kernel.h:11, from /kisskb/src/include/linux/list.h:9, from /kisskb/src/include/linux/wait.h:7, from /kisskb/src/include/linux/completion.h:12, from /kisskb/src/drivers/scsi/sym53c8xx_2/sym_glue.h:43, from /kisskb/src/drivers/scsi/sym53c8xx_2/sym_nvram.c:40: /kisskb/src/arch/xtensa/include/asm/processor.h:220:0: note: this is the location of the previous definition #define WSR(v,sr) __asm__ __volatile__ ("wsr %0,"__stringify(sr) :: "a"(v)); ^ ./usr/include/asm/setup.h:17: userspace cannot reference function or variable defined in the kernel Completed OK # rm -rf /kisskb/build/linus_xtensa-allmodconfig_xtensa # Build took: 0:12:28.511286