diff options
-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 | 13 | ||||
-rw-r--r-- | arch/s390/kernel/syscalls.S | 4 | ||||
-rw-r--r-- | arch/sparc/kernel/sys32.S | 9 | ||||
-rw-r--r-- | arch/sparc/kernel/systbls_64.S | 2 | ||||
-rw-r--r-- | arch/unicore32/kernel/sys.c | 10 | ||||
-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/include/asm/syscalls.h | 4 | ||||
-rw-r--r-- | arch/x86/kernel/vm86_32.c | 38 | ||||
-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 | ||||
-rw-r--r-- | kernel/sysctl_binary.c | 4 |
20 files changed, 45 insertions, 107 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..9cb1b975b353 100644 --- a/arch/s390/kernel/compat_wrapper.S +++ b/arch/s390/kernel/compat_wrapper.S | |||
@@ -793,10 +793,6 @@ ENTRY(sys32_stime_wrapper) | |||
793 | llgtr %r2,%r2 # long * | 793 | llgtr %r2,%r2 # long * |
794 | jg compat_sys_stime # branch to system call | 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 | ENTRY(sys32_fstat64_wrapper) | 796 | ENTRY(sys32_fstat64_wrapper) |
801 | llgfr %r2,%r2 # unsigned long | 797 | llgfr %r2,%r2 # unsigned long |
802 | llgtr %r3,%r3 # struct stat64 * | 798 | llgtr %r3,%r3 # struct stat64 * |
@@ -1349,15 +1345,6 @@ ENTRY(sys_fanotify_init_wrapper) | |||
1349 | llgfr %r3,%r3 # unsigned int | 1345 | llgfr %r3,%r3 # unsigned int |
1350 | jg sys_fanotify_init # branch to system call | 1346 | jg sys_fanotify_init # branch to system call |
1351 | 1347 | ||
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) | 1348 | ENTRY(sys_prlimit64_wrapper) |
1362 | lgfr %r2,%r2 # pid_t | 1349 | lgfr %r2,%r2 # pid_t |
1363 | llgfr %r3,%r3 # unsigned int | 1350 | llgfr %r3,%r3 # unsigned int |
diff --git a/arch/s390/kernel/syscalls.S b/arch/s390/kernel/syscalls.S index 9f214e992eed..913410bd74a3 100644 --- a/arch/s390/kernel/syscalls.S +++ b/arch/s390/kernel/syscalls.S | |||
@@ -157,7 +157,7 @@ SYSCALL(sys_readv,sys_readv,compat_sys_readv_wrapper) /* 145 */ | |||
157 | SYSCALL(sys_writev,sys_writev,compat_sys_writev_wrapper) | 157 | SYSCALL(sys_writev,sys_writev,compat_sys_writev_wrapper) |
158 | SYSCALL(sys_getsid,sys_getsid,sys32_getsid_wrapper) | 158 | SYSCALL(sys_getsid,sys_getsid,sys32_getsid_wrapper) |
159 | SYSCALL(sys_fdatasync,sys_fdatasync,sys32_fdatasync_wrapper) | 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 | SYSCALL(sys_mlock,sys_mlock,sys32_mlock_wrapper) /* 150 */ | 161 | SYSCALL(sys_mlock,sys_mlock,sys32_mlock_wrapper) /* 150 */ |
162 | SYSCALL(sys_munlock,sys_munlock,sys32_munlock_wrapper) | 162 | SYSCALL(sys_munlock,sys_munlock,sys32_munlock_wrapper) |
163 | SYSCALL(sys_mlockall,sys_mlockall,sys32_mlockall_wrapper) | 163 | SYSCALL(sys_mlockall,sys_mlockall,sys32_mlockall_wrapper) |
@@ -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/unicore32/kernel/sys.c b/arch/unicore32/kernel/sys.c index cfe79c9529b3..f9e862539314 100644 --- a/arch/unicore32/kernel/sys.c +++ b/arch/unicore32/kernel/sys.c | |||
@@ -28,19 +28,11 @@ | |||
28 | #include <asm/syscalls.h> | 28 | #include <asm/syscalls.h> |
29 | #include <asm/cacheflush.h> | 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 | /* Provide the actual syscall number to call mapping. */ | 31 | /* Provide the actual syscall number to call mapping. */ |
41 | #undef __SYSCALL | 32 | #undef __SYSCALL |
42 | #define __SYSCALL(nr, call) [nr] = (call), | 33 | #define __SYSCALL(nr, call) [nr] = (call), |
43 | 34 | ||
35 | #define sys_mmap2 sys_mmap_pgoff | ||
44 | /* Note that we don't include <linux/unistd.h> but <asm/unistd.h> */ | 36 | /* Note that we don't include <linux/unistd.h> but <asm/unistd.h> */ |
45 | void *sys_call_table[__NR_syscalls] = { | 37 | void *sys_call_table[__NR_syscalls] = { |
46 | [0 ... __NR_syscalls-1] = sys_ni_syscall, | 38 | [0 ... __NR_syscalls-1] = sys_ni_syscall, |
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/include/asm/syscalls.h b/arch/x86/include/asm/syscalls.h index 5f87b35fd2ef..2917a6452c49 100644 --- a/arch/x86/include/asm/syscalls.h +++ b/arch/x86/include/asm/syscalls.h | |||
@@ -37,8 +37,8 @@ asmlinkage long sys_get_thread_area(struct user_desc __user *); | |||
37 | unsigned long sys_sigreturn(void); | 37 | unsigned long sys_sigreturn(void); |
38 | 38 | ||
39 | /* kernel/vm86_32.c */ | 39 | /* kernel/vm86_32.c */ |
40 | int sys_vm86old(struct vm86_struct __user *); | 40 | asmlinkage long sys_vm86old(struct vm86_struct __user *); |
41 | int sys_vm86(unsigned long, unsigned long); | 41 | asmlinkage long sys_vm86(unsigned long, unsigned long); |
42 | 42 | ||
43 | #else /* CONFIG_X86_32 */ | 43 | #else /* CONFIG_X86_32 */ |
44 | 44 | ||
diff --git a/arch/x86/kernel/vm86_32.c b/arch/x86/kernel/vm86_32.c index 1cf5766dde16..e8edcf52e069 100644 --- a/arch/x86/kernel/vm86_32.c +++ b/arch/x86/kernel/vm86_32.c | |||
@@ -33,6 +33,7 @@ | |||
33 | #include <linux/capability.h> | 33 | #include <linux/capability.h> |
34 | #include <linux/errno.h> | 34 | #include <linux/errno.h> |
35 | #include <linux/interrupt.h> | 35 | #include <linux/interrupt.h> |
36 | #include <linux/syscalls.h> | ||
36 | #include <linux/sched.h> | 37 | #include <linux/sched.h> |
37 | #include <linux/kernel.h> | 38 | #include <linux/kernel.h> |
38 | #include <linux/signal.h> | 39 | #include <linux/signal.h> |
@@ -48,7 +49,6 @@ | |||
48 | #include <asm/io.h> | 49 | #include <asm/io.h> |
49 | #include <asm/tlbflush.h> | 50 | #include <asm/tlbflush.h> |
50 | #include <asm/irq.h> | 51 | #include <asm/irq.h> |
51 | #include <asm/syscalls.h> | ||
52 | 52 | ||
53 | /* | 53 | /* |
54 | * Known problems: | 54 | * Known problems: |
@@ -202,36 +202,32 @@ out: | |||
202 | static int do_vm86_irq_handling(int subfunction, int irqnumber); | 202 | static int do_vm86_irq_handling(int subfunction, int irqnumber); |
203 | static void do_sys_vm86(struct kernel_vm86_struct *info, struct task_struct *tsk); | 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 | struct kernel_vm86_struct info; /* declare this _on top_, | 207 | struct kernel_vm86_struct info; /* declare this _on top_, |
208 | * this avoids wasting of stack space. | 208 | * this avoids wasting of stack space. |
209 | * This remains on the stack until we | 209 | * This remains on the stack until we |
210 | * return to 32 bit user space. | 210 | * return to 32 bit user space. |
211 | */ | 211 | */ |
212 | struct task_struct *tsk; | 212 | struct task_struct *tsk = current; |
213 | int tmp, ret = -EPERM; | 213 | int tmp; |
214 | 214 | ||
215 | tsk = current; | ||
216 | if (tsk->thread.saved_sp0) | 215 | if (tsk->thread.saved_sp0) |
217 | goto out; | 216 | return -EPERM; |
218 | tmp = copy_vm86_regs_from_user(&info.regs, &v86->regs, | 217 | tmp = copy_vm86_regs_from_user(&info.regs, &v86->regs, |
219 | offsetof(struct kernel_vm86_struct, vm86plus) - | 218 | offsetof(struct kernel_vm86_struct, vm86plus) - |
220 | sizeof(info.regs)); | 219 | sizeof(info.regs)); |
221 | ret = -EFAULT; | ||
222 | if (tmp) | 220 | if (tmp) |
223 | goto out; | 221 | return -EFAULT; |
224 | memset(&info.vm86plus, 0, (int)&info.regs32 - (int)&info.vm86plus); | 222 | memset(&info.vm86plus, 0, (int)&info.regs32 - (int)&info.vm86plus); |
225 | info.regs32 = current_pt_regs(); | 223 | info.regs32 = current_pt_regs(); |
226 | tsk->thread.vm86_info = v86; | 224 | tsk->thread.vm86_info = v86; |
227 | do_sys_vm86(&info, tsk); | 225 | do_sys_vm86(&info, tsk); |
228 | ret = 0; /* we never return here */ | 226 | return 0; /* we never return here */ |
229 | out: | ||
230 | return ret; | ||
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 | struct kernel_vm86_struct info; /* declare this _on top_, | 232 | struct kernel_vm86_struct info; /* declare this _on top_, |
237 | * this avoids wasting of stack space. | 233 | * this avoids wasting of stack space. |
@@ -239,7 +235,7 @@ int sys_vm86(unsigned long cmd, unsigned long arg) | |||
239 | * return to 32 bit user space. | 235 | * return to 32 bit user space. |
240 | */ | 236 | */ |
241 | struct task_struct *tsk; | 237 | struct task_struct *tsk; |
242 | int tmp, ret; | 238 | int tmp; |
243 | struct vm86plus_struct __user *v86; | 239 | struct vm86plus_struct __user *v86; |
244 | 240 | ||
245 | tsk = current; | 241 | tsk = current; |
@@ -248,8 +244,7 @@ int sys_vm86(unsigned long cmd, unsigned long arg) | |||
248 | case VM86_FREE_IRQ: | 244 | case VM86_FREE_IRQ: |
249 | case VM86_GET_IRQ_BITS: | 245 | case VM86_GET_IRQ_BITS: |
250 | case VM86_GET_AND_RESET_IRQ: | 246 | case VM86_GET_AND_RESET_IRQ: |
251 | ret = do_vm86_irq_handling(cmd, (int)arg); | 247 | return do_vm86_irq_handling(cmd, (int)arg); |
252 | goto out; | ||
253 | case VM86_PLUS_INSTALL_CHECK: | 248 | case VM86_PLUS_INSTALL_CHECK: |
254 | /* | 249 | /* |
255 | * NOTE: on old vm86 stuff this will return the error | 250 | * NOTE: on old vm86 stuff this will return the error |
@@ -257,28 +252,23 @@ int sys_vm86(unsigned long cmd, unsigned long arg) | |||
257 | * interpreted as (invalid) address to vm86_struct. | 252 | * interpreted as (invalid) address to vm86_struct. |
258 | * So the installation check works. | 253 | * So the installation check works. |
259 | */ | 254 | */ |
260 | ret = 0; | 255 | return 0; |
261 | goto out; | ||
262 | } | 256 | } |
263 | 257 | ||
264 | /* we come here only for functions VM86_ENTER, VM86_ENTER_NO_BYPASS */ | 258 | /* we come here only for functions VM86_ENTER, VM86_ENTER_NO_BYPASS */ |
265 | ret = -EPERM; | ||
266 | if (tsk->thread.saved_sp0) | 259 | if (tsk->thread.saved_sp0) |
267 | goto out; | 260 | return -EPERM; |
268 | v86 = (struct vm86plus_struct __user *)arg; | 261 | v86 = (struct vm86plus_struct __user *)arg; |
269 | tmp = copy_vm86_regs_from_user(&info.regs, &v86->regs, | 262 | tmp = copy_vm86_regs_from_user(&info.regs, &v86->regs, |
270 | offsetof(struct kernel_vm86_struct, regs32) - | 263 | offsetof(struct kernel_vm86_struct, regs32) - |
271 | sizeof(info.regs)); | 264 | sizeof(info.regs)); |
272 | ret = -EFAULT; | ||
273 | if (tmp) | 265 | if (tmp) |
274 | goto out; | 266 | return -EFAULT; |
275 | info.regs32 = current_pt_regs(); | 267 | info.regs32 = current_pt_regs(); |
276 | info.vm86plus.is_vm86pus = 1; | 268 | info.vm86plus.is_vm86pus = 1; |
277 | tsk->thread.vm86_info = (struct vm86_struct __user *)v86; | 269 | tsk->thread.vm86_info = (struct vm86_struct __user *)v86; |
278 | do_sys_vm86(&info, tsk); | 270 | do_sys_vm86(&info, tsk); |
279 | ret = 0; /* we never return here */ | 271 | return 0; /* we never return here */ |
280 | out: | ||
281 | return ret; | ||
282 | } | 272 | } |
283 | 273 | ||
284 | 274 | ||
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); |
diff --git a/kernel/sysctl_binary.c b/kernel/sysctl_binary.c index ebf72358e86a..aea4a9ea6fc8 100644 --- a/kernel/sysctl_binary.c +++ b/kernel/sysctl_binary.c | |||
@@ -15,6 +15,7 @@ | |||
15 | #include <linux/netdevice.h> | 15 | #include <linux/netdevice.h> |
16 | #include <linux/kernel.h> | 16 | #include <linux/kernel.h> |
17 | #include <linux/slab.h> | 17 | #include <linux/slab.h> |
18 | #include <linux/compat.h> | ||
18 | 19 | ||
19 | #ifdef CONFIG_SYSCTL_SYSCALL | 20 | #ifdef CONFIG_SYSCTL_SYSCALL |
20 | 21 | ||
@@ -1447,7 +1448,6 @@ SYSCALL_DEFINE1(sysctl, struct __sysctl_args __user *, args) | |||
1447 | 1448 | ||
1448 | 1449 | ||
1449 | #ifdef CONFIG_COMPAT | 1450 | #ifdef CONFIG_COMPAT |
1450 | #include <asm/compat.h> | ||
1451 | 1451 | ||
1452 | struct compat_sysctl_args { | 1452 | struct compat_sysctl_args { |
1453 | compat_uptr_t name; | 1453 | compat_uptr_t name; |
@@ -1459,7 +1459,7 @@ struct compat_sysctl_args { | |||
1459 | compat_ulong_t __unused[4]; | 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 | struct compat_sysctl_args tmp; | 1464 | struct compat_sysctl_args tmp; |
1465 | compat_size_t __user *compat_oldlenp; | 1465 | compat_size_t __user *compat_oldlenp; |