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

unify compat fanotify_mark(2), switch to COMPAT_SYSCALL_DEFINE

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>

Al Viro 91c2e0bc 5522ddb3

+25 -65
+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 - }
-9
arch/s390/kernel/compat_wrapper.S
··· 1349 1349 llgfr %r3,%r3 # unsigned int 1350 1350 jg sys_fanotify_init # branch to system call 1351 1351 1352 - ENTRY(sys_fanotify_mark_wrapper) 1353 - lgfr %r2,%r2 # int 1354 - llgfr %r3,%r3 # unsigned int 1355 - sllg %r4,%r4,32 # get high word of 64bit mask 1356 - lr %r4,%r5 # get low word of 64bit mask 1357 - llgfr %r5,%r6 # unsigned int 1358 - llgt %r6,164(%r15) # char * 1359 - jg sys_fanotify_mark # branch to system call 1360 - 1361 1352 ENTRY(sys_prlimit64_wrapper) 1362 1353 lgfr %r2,%r2 # pid_t 1363 1354 llgfr %r3,%r3 # unsigned int
+1 -1
arch/s390/kernel/syscalls.S
··· 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
-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 */
+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);