Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/signal

Pull stray syscall bits from Al Viro:
"Several syscall-related commits that were missing from the original"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/signal:
switch compat_sys_sysctl to COMPAT_SYSCALL_DEFINE
unicore32: just use mmap_pgoff()...
unify compat fanotify_mark(2), switch to COMPAT_SYSCALL_DEFINE
x86, vm86: fix VM86 syscalls: use SYSCALL_DEFINEx(...)

+45 -107
+1 -1
arch/arm64/include/asm/unistd32.h
··· 389 389 __SYSCALL(365, compat_sys_recvmmsg) 390 390 __SYSCALL(366, sys_accept4) 391 391 __SYSCALL(367, sys_fanotify_init) 392 - __SYSCALL(368, compat_sys_fanotify_mark_wrapper) 392 + __SYSCALL(368, compat_sys_fanotify_mark) 393 393 __SYSCALL(369, sys_prlimit64) 394 394 __SYSCALL(370, sys_name_to_handle_at) 395 395 __SYSCALL(371, compat_sys_open_by_handle_at)
-7
arch/arm64/kernel/sys32.S
··· 104 104 b sys_fallocate 105 105 ENDPROC(compat_sys_fallocate_wrapper) 106 106 107 - compat_sys_fanotify_mark_wrapper: 108 - orr x2, x2, x3, lsl #32 109 - mov w3, w4 110 - mov w4, w5 111 - b sys_fanotify_mark 112 - ENDPROC(compat_sys_fanotify_mark_wrapper) 113 - 114 107 #undef __SYSCALL 115 108 #define __SYSCALL(x, y) .quad y // x 116 109
-7
arch/mips/kernel/linux32.c
··· 165 165 return sys_fallocate(fd, mode, merge_64(offset_a2, offset_a3), 166 166 merge_64(len_a4, len_a5)); 167 167 } 168 - 169 - SYSCALL_DEFINE6(32_fanotify_mark, int, fanotify_fd, unsigned int, flags, 170 - u64, a3, u64, a4, int, dfd, const char __user *, pathname) 171 - { 172 - return sys_fanotify_mark(fanotify_fd, flags, merge_64(a3, a4), 173 - dfd, pathname); 174 - }
+1 -1
arch/mips/kernel/scall64-o32.S
··· 529 529 PTR sys_accept4 530 530 PTR compat_sys_recvmmsg /* 4335 */ 531 531 PTR sys_fanotify_init 532 - PTR sys_32_fanotify_mark 532 + PTR compat_sys_fanotify_mark 533 533 PTR sys_prlimit64 534 534 PTR sys_name_to_handle_at 535 535 PTR compat_sys_open_by_handle_at /* 4340 */
-8
arch/parisc/kernel/sys_parisc32.c
··· 59 59 current->comm, current->pid, r20); 60 60 return -ENOSYS; 61 61 } 62 - 63 - asmlinkage long compat_sys_fanotify_mark(int fan_fd, int flags, u32 mask_hi, 64 - u32 mask_lo, int fd, 65 - const char __user *pathname) 66 - { 67 - return sys_fanotify_mark(fan_fd, flags, ((u64)mask_hi << 32) | mask_lo, 68 - fd, pathname); 69 - }
-8
arch/powerpc/kernel/sys_ppc32.c
··· 126 126 127 127 return sys_sync_file_range(fd, offset, nbytes, flags); 128 128 } 129 - 130 - asmlinkage long compat_sys_fanotify_mark(int fanotify_fd, unsigned int flags, 131 - unsigned mask_hi, unsigned mask_lo, 132 - int dfd, const char __user *pathname) 133 - { 134 - u64 mask = ((u64)mask_hi << 32) | mask_lo; 135 - return sys_fanotify_mark(fanotify_fd, flags, mask, dfd, pathname); 136 - }
-13
arch/s390/kernel/compat_wrapper.S
··· 793 793 llgtr %r2,%r2 # long * 794 794 jg compat_sys_stime # branch to system call 795 795 796 - ENTRY(sys32_sysctl_wrapper) 797 - llgtr %r2,%r2 # struct compat_sysctl_args * 798 - jg compat_sys_sysctl 799 - 800 796 ENTRY(sys32_fstat64_wrapper) 801 797 llgfr %r2,%r2 # unsigned long 802 798 llgtr %r3,%r3 # struct stat64 * ··· 1344 1348 llgfr %r2,%r2 # unsigned int 1345 1349 llgfr %r3,%r3 # unsigned int 1346 1350 jg sys_fanotify_init # branch to system call 1347 - 1348 - ENTRY(sys_fanotify_mark_wrapper) 1349 - lgfr %r2,%r2 # int 1350 - llgfr %r3,%r3 # unsigned int 1351 - sllg %r4,%r4,32 # get high word of 64bit mask 1352 - lr %r4,%r5 # get low word of 64bit mask 1353 - llgfr %r5,%r6 # unsigned int 1354 - llgt %r6,164(%r15) # char * 1355 - jg sys_fanotify_mark # branch to system call 1356 1351 1357 1352 ENTRY(sys_prlimit64_wrapper) 1358 1353 lgfr %r2,%r2 # pid_t
+2 -2
arch/s390/kernel/syscalls.S
··· 157 157 SYSCALL(sys_writev,sys_writev,compat_sys_writev_wrapper) 158 158 SYSCALL(sys_getsid,sys_getsid,sys32_getsid_wrapper) 159 159 SYSCALL(sys_fdatasync,sys_fdatasync,sys32_fdatasync_wrapper) 160 - SYSCALL(sys_sysctl,sys_sysctl,sys32_sysctl_wrapper) 160 + SYSCALL(sys_sysctl,sys_sysctl,compat_sys_sysctl) 161 161 SYSCALL(sys_mlock,sys_mlock,sys32_mlock_wrapper) /* 150 */ 162 162 SYSCALL(sys_munlock,sys_munlock,sys32_munlock_wrapper) 163 163 SYSCALL(sys_mlockall,sys_mlockall,sys32_mlockall_wrapper) ··· 341 341 SYSCALL(sys_rt_tgsigqueueinfo,sys_rt_tgsigqueueinfo,compat_sys_rt_tgsigqueueinfo) /* 330 */ 342 342 SYSCALL(sys_perf_event_open,sys_perf_event_open,sys_perf_event_open_wrapper) 343 343 SYSCALL(sys_fanotify_init,sys_fanotify_init,sys_fanotify_init_wrapper) 344 - SYSCALL(sys_fanotify_mark,sys_fanotify_mark,sys_fanotify_mark_wrapper) 344 + SYSCALL(sys_fanotify_mark,sys_fanotify_mark,compat_sys_fanotify_mark) 345 345 SYSCALL(sys_prlimit64,sys_prlimit64,sys_prlimit64_wrapper) 346 346 SYSCALL(sys_name_to_handle_at,sys_name_to_handle_at,sys_name_to_handle_at_wrapper) /* 335 */ 347 347 SYSCALL(sys_open_by_handle_at,sys_open_by_handle_at,compat_sys_open_by_handle_at)
-9
arch/sparc/kernel/sys32.S
··· 239 239 nop 240 240 nop 241 241 242 - .globl sys32_fanotify_mark 243 - sys32_fanotify_mark: 244 - sethi %hi(sys_fanotify_mark), %g1 245 - sllx %o2, 32, %o2 246 - or %o2, %o3, %o2 247 - mov %o4, %o3 248 - jmpl %g1 + %lo(sys_fanotify_mark), %g0 249 - mov %o5, %o4 250 - 251 242 .section __ex_table,"a" 252 243 .align 4 253 244 .word 1b, __retl_efault, 2b, __retl_efault
+1 -1
arch/sparc/kernel/systbls_64.S
··· 84 84 .word compat_sys_timerfd_settime, compat_sys_timerfd_gettime, compat_sys_signalfd4, sys_eventfd2, sys_epoll_create1 85 85 /*320*/ .word sys_dup3, sys_pipe2, sys_inotify_init1, sys_accept4, compat_sys_preadv 86 86 .word compat_sys_pwritev, compat_sys_rt_tgsigqueueinfo, sys_perf_event_open, compat_sys_recvmmsg, sys_fanotify_init 87 - /*330*/ .word sys32_fanotify_mark, sys_prlimit64, sys_name_to_handle_at, compat_sys_open_by_handle_at, compat_sys_clock_adjtime 87 + /*330*/ .word compat_sys_fanotify_mark, sys_prlimit64, sys_name_to_handle_at, compat_sys_open_by_handle_at, compat_sys_clock_adjtime 88 88 .word sys_syncfs, compat_sys_sendmmsg, sys_setns, compat_sys_process_vm_readv, compat_sys_process_vm_writev 89 89 /*340*/ .word sys_kern_features, sys_kcmp, sys_finit_module 90 90
+1 -9
arch/unicore32/kernel/sys.c
··· 28 28 #include <asm/syscalls.h> 29 29 #include <asm/cacheflush.h> 30 30 31 - /* Note: used by the compat code even in 64-bit Linux. */ 32 - SYSCALL_DEFINE6(mmap2, unsigned long, addr, unsigned long, len, 33 - unsigned long, prot, unsigned long, flags, 34 - unsigned long, fd, unsigned long, off_4k) 35 - { 36 - return sys_mmap_pgoff(addr, len, prot, flags, fd, 37 - off_4k); 38 - } 39 - 40 31 /* Provide the actual syscall number to call mapping. */ 41 32 #undef __SYSCALL 42 33 #define __SYSCALL(nr, call) [nr] = (call), 43 34 35 + #define sys_mmap2 sys_mmap_pgoff 44 36 /* Note that we don't include <linux/unistd.h> but <asm/unistd.h> */ 45 37 void *sys_call_table[__NR_syscalls] = { 46 38 [0 ... __NR_syscalls-1] = sys_ni_syscall,
-9
arch/x86/ia32/sys_ia32.c
··· 243 243 return sys_fallocate(fd, mode, ((u64)offset_hi << 32) | offset_lo, 244 244 ((u64)len_hi << 32) | len_lo); 245 245 } 246 - 247 - asmlinkage long sys32_fanotify_mark(int fanotify_fd, unsigned int flags, 248 - u32 mask_lo, u32 mask_hi, 249 - int fd, const char __user *pathname) 250 - { 251 - return sys_fanotify_mark(fanotify_fd, flags, 252 - ((u64)mask_hi << 32) | mask_lo, 253 - fd, pathname); 254 - }
-3
arch/x86/include/asm/sys_ia32.h
··· 50 50 asmlinkage long sys32_sigreturn(void); 51 51 asmlinkage long sys32_rt_sigreturn(void); 52 52 53 - asmlinkage long sys32_fanotify_mark(int, unsigned int, u32, u32, int, 54 - const char __user *); 55 - 56 53 #endif /* CONFIG_COMPAT */ 57 54 58 55 #endif /* _ASM_X86_SYS_IA32_H */
+2 -2
arch/x86/include/asm/syscalls.h
··· 37 37 unsigned long sys_sigreturn(void); 38 38 39 39 /* kernel/vm86_32.c */ 40 - int sys_vm86old(struct vm86_struct __user *); 41 - int sys_vm86(unsigned long, unsigned long); 40 + asmlinkage long sys_vm86old(struct vm86_struct __user *); 41 + asmlinkage long sys_vm86(unsigned long, unsigned long); 42 42 43 43 #else /* CONFIG_X86_32 */ 44 44
+14 -24
arch/x86/kernel/vm86_32.c
··· 33 33 #include <linux/capability.h> 34 34 #include <linux/errno.h> 35 35 #include <linux/interrupt.h> 36 + #include <linux/syscalls.h> 36 37 #include <linux/sched.h> 37 38 #include <linux/kernel.h> 38 39 #include <linux/signal.h> ··· 49 48 #include <asm/io.h> 50 49 #include <asm/tlbflush.h> 51 50 #include <asm/irq.h> 52 - #include <asm/syscalls.h> 53 51 54 52 /* 55 53 * Known problems: ··· 202 202 static int do_vm86_irq_handling(int subfunction, int irqnumber); 203 203 static void do_sys_vm86(struct kernel_vm86_struct *info, struct task_struct *tsk); 204 204 205 - int sys_vm86old(struct vm86_struct __user *v86) 205 + SYSCALL_DEFINE1(vm86old, struct vm86_struct __user *, v86) 206 206 { 207 207 struct kernel_vm86_struct info; /* declare this _on top_, 208 208 * this avoids wasting of stack space. 209 209 * This remains on the stack until we 210 210 * return to 32 bit user space. 211 211 */ 212 - struct task_struct *tsk; 213 - int tmp, ret = -EPERM; 212 + struct task_struct *tsk = current; 213 + int tmp; 214 214 215 - tsk = current; 216 215 if (tsk->thread.saved_sp0) 217 - goto out; 216 + return -EPERM; 218 217 tmp = copy_vm86_regs_from_user(&info.regs, &v86->regs, 219 218 offsetof(struct kernel_vm86_struct, vm86plus) - 220 219 sizeof(info.regs)); 221 - ret = -EFAULT; 222 220 if (tmp) 223 - goto out; 221 + return -EFAULT; 224 222 memset(&info.vm86plus, 0, (int)&info.regs32 - (int)&info.vm86plus); 225 223 info.regs32 = current_pt_regs(); 226 224 tsk->thread.vm86_info = v86; 227 225 do_sys_vm86(&info, tsk); 228 - ret = 0; /* we never return here */ 229 - out: 230 - return ret; 226 + return 0; /* we never return here */ 231 227 } 232 228 233 229 234 - int sys_vm86(unsigned long cmd, unsigned long arg) 230 + SYSCALL_DEFINE2(vm86, unsigned long, cmd, unsigned long, arg) 235 231 { 236 232 struct kernel_vm86_struct info; /* declare this _on top_, 237 233 * this avoids wasting of stack space. ··· 235 239 * return to 32 bit user space. 236 240 */ 237 241 struct task_struct *tsk; 238 - int tmp, ret; 242 + int tmp; 239 243 struct vm86plus_struct __user *v86; 240 244 241 245 tsk = current; ··· 244 248 case VM86_FREE_IRQ: 245 249 case VM86_GET_IRQ_BITS: 246 250 case VM86_GET_AND_RESET_IRQ: 247 - ret = do_vm86_irq_handling(cmd, (int)arg); 248 - goto out; 251 + return do_vm86_irq_handling(cmd, (int)arg); 249 252 case VM86_PLUS_INSTALL_CHECK: 250 253 /* 251 254 * NOTE: on old vm86 stuff this will return the error ··· 252 257 * interpreted as (invalid) address to vm86_struct. 253 258 * So the installation check works. 254 259 */ 255 - ret = 0; 256 - goto out; 260 + return 0; 257 261 } 258 262 259 263 /* we come here only for functions VM86_ENTER, VM86_ENTER_NO_BYPASS */ 260 - ret = -EPERM; 261 264 if (tsk->thread.saved_sp0) 262 - goto out; 265 + return -EPERM; 263 266 v86 = (struct vm86plus_struct __user *)arg; 264 267 tmp = copy_vm86_regs_from_user(&info.regs, &v86->regs, 265 268 offsetof(struct kernel_vm86_struct, regs32) - 266 269 sizeof(info.regs)); 267 - ret = -EFAULT; 268 270 if (tmp) 269 - goto out; 271 + return -EFAULT; 270 272 info.regs32 = current_pt_regs(); 271 273 info.vm86plus.is_vm86pus = 1; 272 274 tsk->thread.vm86_info = (struct vm86_struct __user *)v86; 273 275 do_sys_vm86(&info, tsk); 274 - ret = 0; /* we never return here */ 275 - out: 276 - return ret; 276 + return 0; /* we never return here */ 277 277 } 278 278 279 279
+1 -1
arch/x86/syscalls/syscall_32.tbl
··· 345 345 336 i386 perf_event_open sys_perf_event_open 346 346 337 i386 recvmmsg sys_recvmmsg compat_sys_recvmmsg 347 347 338 i386 fanotify_init sys_fanotify_init 348 - 339 i386 fanotify_mark sys_fanotify_mark sys32_fanotify_mark 348 + 339 i386 fanotify_mark sys_fanotify_mark compat_sys_fanotify_mark 349 349 340 i386 prlimit64 sys_prlimit64 350 350 341 i386 name_to_handle_at sys_name_to_handle_at 351 351 342 i386 open_by_handle_at sys_open_by_handle_at compat_sys_open_by_handle_at
+17
fs/notify/fanotify/fanotify_user.c
··· 13 13 #include <linux/slab.h> 14 14 #include <linux/types.h> 15 15 #include <linux/uaccess.h> 16 + #include <linux/compat.h> 16 17 17 18 #include <asm/ioctls.h> 18 19 ··· 857 856 fdput(f); 858 857 return ret; 859 858 } 859 + 860 + #ifdef CONFIG_COMPAT 861 + COMPAT_SYSCALL_DEFINE6(fanotify_mark, 862 + int, fanotify_fd, unsigned int, flags, 863 + __u32, mask0, __u32, mask1, int, dfd, 864 + const char __user *, pathname) 865 + { 866 + return sys_fanotify_mark(fanotify_fd, flags, 867 + #ifdef __BIG_ENDIAN 868 + ((__u64)mask1 << 32) | mask0, 869 + #else 870 + ((__u64)mask0 << 32) | mask1, 871 + #endif 872 + dfd, pathname); 873 + } 874 + #endif 860 875 861 876 /* 862 877 * fanotify_user_setup - Our initialization function. Note that we cannot return
+2
include/linux/compat.h
··· 673 673 asmlinkage long compat_sys_sched_rr_get_interval(compat_pid_t pid, 674 674 struct compat_timespec __user *interval); 675 675 676 + asmlinkage long compat_sys_fanotify_mark(int, unsigned int, __u32, __u32, 677 + int, const char __user *); 676 678 #else 677 679 678 680 #define is_compat_task() (0)
+1
kernel/sys_ni.c
··· 200 200 /* fanotify! */ 201 201 cond_syscall(sys_fanotify_init); 202 202 cond_syscall(sys_fanotify_mark); 203 + cond_syscall(compat_sys_fanotify_mark); 203 204 204 205 /* open by handle */ 205 206 cond_syscall(sys_name_to_handle_at);
+2 -2
kernel/sysctl_binary.c
··· 15 15 #include <linux/netdevice.h> 16 16 #include <linux/kernel.h> 17 17 #include <linux/slab.h> 18 + #include <linux/compat.h> 18 19 19 20 #ifdef CONFIG_SYSCTL_SYSCALL 20 21 ··· 1448 1447 1449 1448 1450 1449 #ifdef CONFIG_COMPAT 1451 - #include <asm/compat.h> 1452 1450 1453 1451 struct compat_sysctl_args { 1454 1452 compat_uptr_t name; ··· 1459 1459 compat_ulong_t __unused[4]; 1460 1460 }; 1461 1461 1462 - asmlinkage long compat_sys_sysctl(struct compat_sysctl_args __user *args) 1462 + COMPAT_SYSCALL_DEFINE1(sysctl, struct compat_sysctl_args __user *, args) 1463 1463 { 1464 1464 struct compat_sysctl_args tmp; 1465 1465 compat_size_t __user *compat_oldlenp;