diff options
| author | Al Viro <viro@zeniv.linux.org.uk> | 2013-03-05 20:10:59 -0500 |
|---|---|---|
| committer | Al Viro <viro@zeniv.linux.org.uk> | 2013-05-09 13:46:38 -0400 |
| commit | 91c2e0bcae72a3086c698b5de2b950b885abb0e6 (patch) | |
| tree | 89f738ca8f9519f0fd3b22dd6cfb3dc69d98cfab | |
| parent | 5522ddb3fc0dfd4a503c8278eafd88c9f2d3fada (diff) | |
unify compat fanotify_mark(2), switch to COMPAT_SYSCALL_DEFINE
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
| -rw-r--r-- | arch/arm64/include/asm/unistd32.h | 2 | ||||
| -rw-r--r-- | arch/arm64/kernel/sys32.S | 7 | ||||
| -rw-r--r-- | arch/mips/kernel/linux32.c | 7 | ||||
| -rw-r--r-- | arch/mips/kernel/scall64-o32.S | 2 | ||||
| -rw-r--r-- | arch/parisc/kernel/sys_parisc32.c | 8 | ||||
| -rw-r--r-- | arch/powerpc/kernel/sys_ppc32.c | 8 | ||||
| -rw-r--r-- | arch/s390/kernel/compat_wrapper.S | 9 | ||||
| -rw-r--r-- | arch/s390/kernel/syscalls.S | 2 | ||||
| -rw-r--r-- | arch/sparc/kernel/sys32.S | 9 | ||||
| -rw-r--r-- | arch/sparc/kernel/systbls_64.S | 2 | ||||
| -rw-r--r-- | arch/x86/ia32/sys_ia32.c | 9 | ||||
| -rw-r--r-- | arch/x86/include/asm/sys_ia32.h | 3 | ||||
| -rw-r--r-- | arch/x86/syscalls/syscall_32.tbl | 2 | ||||
| -rw-r--r-- | fs/notify/fanotify/fanotify_user.c | 17 | ||||
| -rw-r--r-- | include/linux/compat.h | 2 | ||||
| -rw-r--r-- | kernel/sys_ni.c | 1 |
16 files changed, 25 insertions, 65 deletions
diff --git a/arch/arm64/include/asm/unistd32.h b/arch/arm64/include/asm/unistd32.h index 12f22492df4c..58125bf008d3 100644 --- a/arch/arm64/include/asm/unistd32.h +++ b/arch/arm64/include/asm/unistd32.h | |||
| @@ -389,7 +389,7 @@ __SYSCALL(364, sys_perf_event_open) | |||
| 389 | __SYSCALL(365, compat_sys_recvmmsg) | 389 | __SYSCALL(365, compat_sys_recvmmsg) |
| 390 | __SYSCALL(366, sys_accept4) | 390 | __SYSCALL(366, sys_accept4) |
| 391 | __SYSCALL(367, sys_fanotify_init) | 391 | __SYSCALL(367, sys_fanotify_init) |
| 392 | __SYSCALL(368, compat_sys_fanotify_mark_wrapper) | 392 | __SYSCALL(368, compat_sys_fanotify_mark) |
| 393 | __SYSCALL(369, sys_prlimit64) | 393 | __SYSCALL(369, sys_prlimit64) |
| 394 | __SYSCALL(370, sys_name_to_handle_at) | 394 | __SYSCALL(370, sys_name_to_handle_at) |
| 395 | __SYSCALL(371, compat_sys_open_by_handle_at) | 395 | __SYSCALL(371, compat_sys_open_by_handle_at) |
diff --git a/arch/arm64/kernel/sys32.S b/arch/arm64/kernel/sys32.S index db01aa978c41..a1b19ed7467c 100644 --- a/arch/arm64/kernel/sys32.S +++ b/arch/arm64/kernel/sys32.S | |||
| @@ -104,13 +104,6 @@ compat_sys_fallocate_wrapper: | |||
| 104 | b sys_fallocate | 104 | b sys_fallocate |
| 105 | ENDPROC(compat_sys_fallocate_wrapper) | 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 | #undef __SYSCALL | 107 | #undef __SYSCALL |
| 115 | #define __SYSCALL(x, y) .quad y // x | 108 | #define __SYSCALL(x, y) .quad y // x |
| 116 | 109 | ||
diff --git a/arch/mips/kernel/linux32.c b/arch/mips/kernel/linux32.c index d1d576b765f5..0b29646bcee7 100644 --- a/arch/mips/kernel/linux32.c +++ b/arch/mips/kernel/linux32.c | |||
| @@ -165,10 +165,3 @@ asmlinkage long sys32_fallocate(int fd, int mode, unsigned offset_a2, | |||
| 165 | return sys_fallocate(fd, mode, merge_64(offset_a2, offset_a3), | 165 | return sys_fallocate(fd, mode, merge_64(offset_a2, offset_a3), |
| 166 | merge_64(len_a4, len_a5)); | 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 | } | ||
diff --git a/arch/mips/kernel/scall64-o32.S b/arch/mips/kernel/scall64-o32.S index 103bfe570fe8..74f485d3c0ef 100644 --- a/arch/mips/kernel/scall64-o32.S +++ b/arch/mips/kernel/scall64-o32.S | |||
| @@ -529,7 +529,7 @@ sys_call_table: | |||
| 529 | PTR sys_accept4 | 529 | PTR sys_accept4 |
| 530 | PTR compat_sys_recvmmsg /* 4335 */ | 530 | PTR compat_sys_recvmmsg /* 4335 */ |
| 531 | PTR sys_fanotify_init | 531 | PTR sys_fanotify_init |
| 532 | PTR sys_32_fanotify_mark | 532 | PTR compat_sys_fanotify_mark |
| 533 | PTR sys_prlimit64 | 533 | PTR sys_prlimit64 |
| 534 | PTR sys_name_to_handle_at | 534 | PTR sys_name_to_handle_at |
| 535 | PTR compat_sys_open_by_handle_at /* 4340 */ | 535 | PTR compat_sys_open_by_handle_at /* 4340 */ |
diff --git a/arch/parisc/kernel/sys_parisc32.c b/arch/parisc/kernel/sys_parisc32.c index f517e08e7f0d..a134ff4da12e 100644 --- a/arch/parisc/kernel/sys_parisc32.c +++ b/arch/parisc/kernel/sys_parisc32.c | |||
| @@ -59,11 +59,3 @@ asmlinkage long sys32_unimplemented(int r26, int r25, int r24, int r23, | |||
| 59 | current->comm, current->pid, r20); | 59 | current->comm, current->pid, r20); |
| 60 | return -ENOSYS; | 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 | } | ||
diff --git a/arch/powerpc/kernel/sys_ppc32.c b/arch/powerpc/kernel/sys_ppc32.c index cd6e19d263b3..8a285876aef8 100644 --- a/arch/powerpc/kernel/sys_ppc32.c +++ b/arch/powerpc/kernel/sys_ppc32.c | |||
| @@ -126,11 +126,3 @@ asmlinkage long compat_sys_sync_file_range2(int fd, unsigned int flags, | |||
| 126 | 126 | ||
| 127 | return sys_sync_file_range(fd, offset, nbytes, flags); | 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 | } | ||
diff --git a/arch/s390/kernel/compat_wrapper.S b/arch/s390/kernel/compat_wrapper.S index 2d72d9e96c15..99696783fbf7 100644 --- a/arch/s390/kernel/compat_wrapper.S +++ b/arch/s390/kernel/compat_wrapper.S | |||
| @@ -1349,15 +1349,6 @@ ENTRY(sys_fanotify_init_wrapper) | |||
| 1349 | llgfr %r3,%r3 # unsigned int | 1349 | llgfr %r3,%r3 # unsigned int |
| 1350 | jg sys_fanotify_init # branch to system call | 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 | ENTRY(sys_prlimit64_wrapper) | 1352 | ENTRY(sys_prlimit64_wrapper) |
| 1362 | lgfr %r2,%r2 # pid_t | 1353 | lgfr %r2,%r2 # pid_t |
| 1363 | llgfr %r3,%r3 # unsigned int | 1354 | llgfr %r3,%r3 # unsigned int |
diff --git a/arch/s390/kernel/syscalls.S b/arch/s390/kernel/syscalls.S index 9f214e992eed..9605e063dc8b 100644 --- a/arch/s390/kernel/syscalls.S +++ b/arch/s390/kernel/syscalls.S | |||
| @@ -341,7 +341,7 @@ SYSCALL(sys_pwritev,sys_pwritev,compat_sys_pwritev) | |||
| 341 | SYSCALL(sys_rt_tgsigqueueinfo,sys_rt_tgsigqueueinfo,compat_sys_rt_tgsigqueueinfo) /* 330 */ | 341 | SYSCALL(sys_rt_tgsigqueueinfo,sys_rt_tgsigqueueinfo,compat_sys_rt_tgsigqueueinfo) /* 330 */ |
| 342 | SYSCALL(sys_perf_event_open,sys_perf_event_open,sys_perf_event_open_wrapper) | 342 | SYSCALL(sys_perf_event_open,sys_perf_event_open,sys_perf_event_open_wrapper) |
| 343 | SYSCALL(sys_fanotify_init,sys_fanotify_init,sys_fanotify_init_wrapper) | 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 | SYSCALL(sys_prlimit64,sys_prlimit64,sys_prlimit64_wrapper) | 345 | SYSCALL(sys_prlimit64,sys_prlimit64,sys_prlimit64_wrapper) |
| 346 | SYSCALL(sys_name_to_handle_at,sys_name_to_handle_at,sys_name_to_handle_at_wrapper) /* 335 */ | 346 | SYSCALL(sys_name_to_handle_at,sys_name_to_handle_at,sys_name_to_handle_at_wrapper) /* 335 */ |
| 347 | SYSCALL(sys_open_by_handle_at,sys_open_by_handle_at,compat_sys_open_by_handle_at) | 347 | SYSCALL(sys_open_by_handle_at,sys_open_by_handle_at,compat_sys_open_by_handle_at) |
diff --git a/arch/sparc/kernel/sys32.S b/arch/sparc/kernel/sys32.S index 2e680b5245c9..f7c72b6efc27 100644 --- a/arch/sparc/kernel/sys32.S +++ b/arch/sparc/kernel/sys32.S | |||
| @@ -239,15 +239,6 @@ do_sys_accept4: /* sys_accept4(int, struct sockaddr *, int *, int) */ | |||
| 239 | nop | 239 | nop |
| 240 | nop | 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 | .section __ex_table,"a" | 242 | .section __ex_table,"a" |
| 252 | .align 4 | 243 | .align 4 |
| 253 | .word 1b, __retl_efault, 2b, __retl_efault | 244 | .word 1b, __retl_efault, 2b, __retl_efault |
diff --git a/arch/sparc/kernel/systbls_64.S b/arch/sparc/kernel/systbls_64.S index 8fd932080215..6d81597064b6 100644 --- a/arch/sparc/kernel/systbls_64.S +++ b/arch/sparc/kernel/systbls_64.S | |||
| @@ -84,7 +84,7 @@ sys_call_table32: | |||
| 84 | .word compat_sys_timerfd_settime, compat_sys_timerfd_gettime, compat_sys_signalfd4, sys_eventfd2, sys_epoll_create1 | 84 | .word compat_sys_timerfd_settime, compat_sys_timerfd_gettime, compat_sys_signalfd4, sys_eventfd2, sys_epoll_create1 |
| 85 | /*320*/ .word sys_dup3, sys_pipe2, sys_inotify_init1, sys_accept4, compat_sys_preadv | 85 | /*320*/ .word sys_dup3, sys_pipe2, sys_inotify_init1, sys_accept4, compat_sys_preadv |
| 86 | .word compat_sys_pwritev, compat_sys_rt_tgsigqueueinfo, sys_perf_event_open, compat_sys_recvmmsg, sys_fanotify_init | 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 | .word sys_syncfs, compat_sys_sendmmsg, sys_setns, compat_sys_process_vm_readv, compat_sys_process_vm_writev | 88 | .word sys_syncfs, compat_sys_sendmmsg, sys_setns, compat_sys_process_vm_readv, compat_sys_process_vm_writev |
| 89 | /*340*/ .word sys_kern_features, sys_kcmp, sys_finit_module | 89 | /*340*/ .word sys_kern_features, sys_kcmp, sys_finit_module |
| 90 | 90 | ||
diff --git a/arch/x86/ia32/sys_ia32.c b/arch/x86/ia32/sys_ia32.c index 4e4907c67d92..8e0ceecdc957 100644 --- a/arch/x86/ia32/sys_ia32.c +++ b/arch/x86/ia32/sys_ia32.c | |||
| @@ -243,12 +243,3 @@ asmlinkage long sys32_fallocate(int fd, int mode, unsigned offset_lo, | |||
| 243 | return sys_fallocate(fd, mode, ((u64)offset_hi << 32) | offset_lo, | 243 | return sys_fallocate(fd, mode, ((u64)offset_hi << 32) | offset_lo, |
| 244 | ((u64)len_hi << 32) | len_lo); | 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 | } | ||
diff --git a/arch/x86/include/asm/sys_ia32.h b/arch/x86/include/asm/sys_ia32.h index 0ef202e232d6..82c34ee25a65 100644 --- a/arch/x86/include/asm/sys_ia32.h +++ b/arch/x86/include/asm/sys_ia32.h | |||
| @@ -50,9 +50,6 @@ asmlinkage long sys32_fallocate(int, int, unsigned, | |||
| 50 | asmlinkage long sys32_sigreturn(void); | 50 | asmlinkage long sys32_sigreturn(void); |
| 51 | asmlinkage long sys32_rt_sigreturn(void); | 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 | #endif /* CONFIG_COMPAT */ | 53 | #endif /* CONFIG_COMPAT */ |
| 57 | 54 | ||
| 58 | #endif /* _ASM_X86_SYS_IA32_H */ | 55 | #endif /* _ASM_X86_SYS_IA32_H */ |
diff --git a/arch/x86/syscalls/syscall_32.tbl b/arch/x86/syscalls/syscall_32.tbl index d0d59bfbccce..aabfb8380a1c 100644 --- a/arch/x86/syscalls/syscall_32.tbl +++ b/arch/x86/syscalls/syscall_32.tbl | |||
| @@ -345,7 +345,7 @@ | |||
| 345 | 336 i386 perf_event_open sys_perf_event_open | 345 | 336 i386 perf_event_open sys_perf_event_open |
| 346 | 337 i386 recvmmsg sys_recvmmsg compat_sys_recvmmsg | 346 | 337 i386 recvmmsg sys_recvmmsg compat_sys_recvmmsg |
| 347 | 338 i386 fanotify_init sys_fanotify_init | 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 | 340 i386 prlimit64 sys_prlimit64 | 349 | 340 i386 prlimit64 sys_prlimit64 |
| 350 | 341 i386 name_to_handle_at sys_name_to_handle_at | 350 | 341 i386 name_to_handle_at sys_name_to_handle_at |
| 351 | 342 i386 open_by_handle_at sys_open_by_handle_at compat_sys_open_by_handle_at | 351 | 342 i386 open_by_handle_at sys_open_by_handle_at compat_sys_open_by_handle_at |
diff --git a/fs/notify/fanotify/fanotify_user.c b/fs/notify/fanotify/fanotify_user.c index d0be29fa94cf..6c80083a984f 100644 --- a/fs/notify/fanotify/fanotify_user.c +++ b/fs/notify/fanotify/fanotify_user.c | |||
| @@ -13,6 +13,7 @@ | |||
| 13 | #include <linux/slab.h> | 13 | #include <linux/slab.h> |
| 14 | #include <linux/types.h> | 14 | #include <linux/types.h> |
| 15 | #include <linux/uaccess.h> | 15 | #include <linux/uaccess.h> |
| 16 | #include <linux/compat.h> | ||
| 16 | 17 | ||
| 17 | #include <asm/ioctls.h> | 18 | #include <asm/ioctls.h> |
| 18 | 19 | ||
| @@ -857,6 +858,22 @@ fput_and_out: | |||
| 857 | return ret; | 858 | return ret; |
| 858 | } | 859 | } |
| 859 | 860 | ||
| 861 | #ifdef CONFIG_COMPAT | ||
| 862 | COMPAT_SYSCALL_DEFINE6(fanotify_mark, | ||
| 863 | int, fanotify_fd, unsigned int, flags, | ||
| 864 | __u32, mask0, __u32, mask1, int, dfd, | ||
| 865 | const char __user *, pathname) | ||
| 866 | { | ||
| 867 | return sys_fanotify_mark(fanotify_fd, flags, | ||
| 868 | #ifdef __BIG_ENDIAN | ||
| 869 | ((__u64)mask1 << 32) | mask0, | ||
| 870 | #else | ||
| 871 | ((__u64)mask0 << 32) | mask1, | ||
| 872 | #endif | ||
| 873 | dfd, pathname); | ||
| 874 | } | ||
| 875 | #endif | ||
| 876 | |||
| 860 | /* | 877 | /* |
| 861 | * fanotify_user_setup - Our initialization function. Note that we cannot return | 878 | * fanotify_user_setup - Our initialization function. Note that we cannot return |
| 862 | * error because we have compiled-in VFS hooks. So an (unlikely) failure here | 879 | * error because we have compiled-in VFS hooks. So an (unlikely) failure here |
diff --git a/include/linux/compat.h b/include/linux/compat.h index d53c35352ea9..7f0c1dd09079 100644 --- a/include/linux/compat.h +++ b/include/linux/compat.h | |||
| @@ -673,6 +673,8 @@ int __compat_save_altstack(compat_stack_t __user *, unsigned long); | |||
| 673 | asmlinkage long compat_sys_sched_rr_get_interval(compat_pid_t pid, | 673 | asmlinkage long compat_sys_sched_rr_get_interval(compat_pid_t pid, |
| 674 | struct compat_timespec __user *interval); | 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 | #else | 678 | #else |
| 677 | 679 | ||
| 678 | #define is_compat_task() (0) | 680 | #define is_compat_task() (0) |
diff --git a/kernel/sys_ni.c b/kernel/sys_ni.c index bfd6787b355a..7078052284fd 100644 --- a/kernel/sys_ni.c +++ b/kernel/sys_ni.c | |||
| @@ -200,6 +200,7 @@ cond_syscall(sys_perf_event_open); | |||
| 200 | /* fanotify! */ | 200 | /* fanotify! */ |
| 201 | cond_syscall(sys_fanotify_init); | 201 | cond_syscall(sys_fanotify_init); |
| 202 | cond_syscall(sys_fanotify_mark); | 202 | cond_syscall(sys_fanotify_mark); |
| 203 | cond_syscall(compat_sys_fanotify_mark); | ||
| 203 | 204 | ||
| 204 | /* open by handle */ | 205 | /* open by handle */ |
| 205 | cond_syscall(sys_name_to_handle_at); | 206 | cond_syscall(sys_name_to_handle_at); |
