diff options
-rw-r--r-- | arch/s390/kernel/compat_wrapper.S | 13 | ||||
-rw-r--r-- | arch/s390/kernel/syscalls.S | 4 | ||||
-rw-r--r-- | fs/compat.c | 30 | ||||
-rw-r--r-- | fs/signalfd.c | 31 |
4 files changed, 33 insertions, 45 deletions
diff --git a/arch/s390/kernel/compat_wrapper.S b/arch/s390/kernel/compat_wrapper.S index 3c98c4dc5aca..626cc6f0f446 100644 --- a/arch/s390/kernel/compat_wrapper.S +++ b/arch/s390/kernel/compat_wrapper.S | |||
@@ -1299,12 +1299,6 @@ ENTRY(compat_sys_utimensat_wrapper) | |||
1299 | lgfr %r5,%r5 # int | 1299 | lgfr %r5,%r5 # int |
1300 | jg compat_sys_utimensat | 1300 | jg compat_sys_utimensat |
1301 | 1301 | ||
1302 | ENTRY(compat_sys_signalfd_wrapper) | ||
1303 | lgfr %r2,%r2 # int | ||
1304 | llgtr %r3,%r3 # compat_sigset_t * | ||
1305 | llgfr %r4,%r4 # compat_size_t | ||
1306 | jg compat_sys_signalfd | ||
1307 | |||
1308 | ENTRY(sys_eventfd_wrapper) | 1302 | ENTRY(sys_eventfd_wrapper) |
1309 | llgfr %r2,%r2 # unsigned int | 1303 | llgfr %r2,%r2 # unsigned int |
1310 | jg sys_eventfd | 1304 | jg sys_eventfd |
@@ -1323,13 +1317,6 @@ ENTRY(sys_timerfd_create_wrapper) | |||
1323 | lgfr %r3,%r3 # int | 1317 | lgfr %r3,%r3 # int |
1324 | jg sys_timerfd_create | 1318 | jg sys_timerfd_create |
1325 | 1319 | ||
1326 | ENTRY(compat_sys_signalfd4_wrapper) | ||
1327 | lgfr %r2,%r2 # int | ||
1328 | llgtr %r3,%r3 # compat_sigset_t * | ||
1329 | llgfr %r4,%r4 # compat_size_t | ||
1330 | lgfr %r5,%r5 # int | ||
1331 | jg compat_sys_signalfd4 | ||
1332 | |||
1333 | ENTRY(sys_eventfd2_wrapper) | 1320 | ENTRY(sys_eventfd2_wrapper) |
1334 | llgfr %r2,%r2 # unsigned int | 1321 | llgfr %r2,%r2 # unsigned int |
1335 | lgfr %r3,%r3 # int | 1322 | lgfr %r3,%r3 # int |
diff --git a/arch/s390/kernel/syscalls.S b/arch/s390/kernel/syscalls.S index 630b935d1284..2695bb89699e 100644 --- a/arch/s390/kernel/syscalls.S +++ b/arch/s390/kernel/syscalls.S | |||
@@ -324,13 +324,13 @@ SYSCALL(sys_epoll_pwait,sys_epoll_pwait,compat_sys_epoll_pwait_wrapper) | |||
324 | SYSCALL(sys_utimes,sys_utimes,compat_sys_utimes_wrapper) | 324 | SYSCALL(sys_utimes,sys_utimes,compat_sys_utimes_wrapper) |
325 | SYSCALL(sys_s390_fallocate,sys_fallocate,sys_fallocate_wrapper) | 325 | SYSCALL(sys_s390_fallocate,sys_fallocate,sys_fallocate_wrapper) |
326 | SYSCALL(sys_utimensat,sys_utimensat,compat_sys_utimensat_wrapper) /* 315 */ | 326 | SYSCALL(sys_utimensat,sys_utimensat,compat_sys_utimensat_wrapper) /* 315 */ |
327 | SYSCALL(sys_signalfd,sys_signalfd,compat_sys_signalfd_wrapper) | 327 | SYSCALL(sys_signalfd,sys_signalfd,compat_sys_signalfd) |
328 | NI_SYSCALL /* 317 old sys_timer_fd */ | 328 | NI_SYSCALL /* 317 old sys_timer_fd */ |
329 | SYSCALL(sys_eventfd,sys_eventfd,sys_eventfd_wrapper) | 329 | SYSCALL(sys_eventfd,sys_eventfd,sys_eventfd_wrapper) |
330 | SYSCALL(sys_timerfd_create,sys_timerfd_create,sys_timerfd_create_wrapper) | 330 | SYSCALL(sys_timerfd_create,sys_timerfd_create,sys_timerfd_create_wrapper) |
331 | SYSCALL(sys_timerfd_settime,sys_timerfd_settime,compat_sys_timerfd_settime) /* 320 */ | 331 | SYSCALL(sys_timerfd_settime,sys_timerfd_settime,compat_sys_timerfd_settime) /* 320 */ |
332 | SYSCALL(sys_timerfd_gettime,sys_timerfd_gettime,compat_sys_timerfd_gettime) | 332 | SYSCALL(sys_timerfd_gettime,sys_timerfd_gettime,compat_sys_timerfd_gettime) |
333 | SYSCALL(sys_signalfd4,sys_signalfd4,compat_sys_signalfd4_wrapper) | 333 | SYSCALL(sys_signalfd4,sys_signalfd4,compat_sys_signalfd4) |
334 | SYSCALL(sys_eventfd2,sys_eventfd2,sys_eventfd2_wrapper) | 334 | SYSCALL(sys_eventfd2,sys_eventfd2,sys_eventfd2_wrapper) |
335 | SYSCALL(sys_inotify_init1,sys_inotify_init1,sys_inotify_init1_wrapper) | 335 | SYSCALL(sys_inotify_init1,sys_inotify_init1,sys_inotify_init1_wrapper) |
336 | SYSCALL(sys_pipe2,sys_pipe2,sys_pipe2_wrapper) /* 325 */ | 336 | SYSCALL(sys_pipe2,sys_pipe2,sys_pipe2_wrapper) /* 325 */ |
diff --git a/fs/compat.c b/fs/compat.c index fe40fde29111..cc09312f9aed 100644 --- a/fs/compat.c +++ b/fs/compat.c | |||
@@ -1707,36 +1707,6 @@ asmlinkage long compat_sys_epoll_pwait(int epfd, | |||
1707 | 1707 | ||
1708 | #endif /* CONFIG_EPOLL */ | 1708 | #endif /* CONFIG_EPOLL */ |
1709 | 1709 | ||
1710 | #ifdef CONFIG_SIGNALFD | ||
1711 | |||
1712 | asmlinkage long compat_sys_signalfd4(int ufd, | ||
1713 | const compat_sigset_t __user *sigmask, | ||
1714 | compat_size_t sigsetsize, int flags) | ||
1715 | { | ||
1716 | compat_sigset_t ss32; | ||
1717 | sigset_t tmp; | ||
1718 | sigset_t __user *ksigmask; | ||
1719 | |||
1720 | if (sigsetsize != sizeof(compat_sigset_t)) | ||
1721 | return -EINVAL; | ||
1722 | if (copy_from_user(&ss32, sigmask, sizeof(ss32))) | ||
1723 | return -EFAULT; | ||
1724 | sigset_from_compat(&tmp, &ss32); | ||
1725 | ksigmask = compat_alloc_user_space(sizeof(sigset_t)); | ||
1726 | if (copy_to_user(ksigmask, &tmp, sizeof(sigset_t))) | ||
1727 | return -EFAULT; | ||
1728 | |||
1729 | return sys_signalfd4(ufd, ksigmask, sizeof(sigset_t), flags); | ||
1730 | } | ||
1731 | |||
1732 | asmlinkage long compat_sys_signalfd(int ufd, | ||
1733 | const compat_sigset_t __user *sigmask, | ||
1734 | compat_size_t sigsetsize) | ||
1735 | { | ||
1736 | return compat_sys_signalfd4(ufd, sigmask, sigsetsize, 0); | ||
1737 | } | ||
1738 | #endif /* CONFIG_SIGNALFD */ | ||
1739 | |||
1740 | #ifdef CONFIG_FHANDLE | 1710 | #ifdef CONFIG_FHANDLE |
1741 | /* | 1711 | /* |
1742 | * Exactly like fs/open.c:sys_open_by_handle_at(), except that it | 1712 | * Exactly like fs/open.c:sys_open_by_handle_at(), except that it |
diff --git a/fs/signalfd.c b/fs/signalfd.c index b53486961735..424b7b65321f 100644 --- a/fs/signalfd.c +++ b/fs/signalfd.c | |||
@@ -30,6 +30,7 @@ | |||
30 | #include <linux/signalfd.h> | 30 | #include <linux/signalfd.h> |
31 | #include <linux/syscalls.h> | 31 | #include <linux/syscalls.h> |
32 | #include <linux/proc_fs.h> | 32 | #include <linux/proc_fs.h> |
33 | #include <linux/compat.h> | ||
33 | 34 | ||
34 | void signalfd_cleanup(struct sighand_struct *sighand) | 35 | void signalfd_cleanup(struct sighand_struct *sighand) |
35 | { | 36 | { |
@@ -311,3 +312,33 @@ SYSCALL_DEFINE3(signalfd, int, ufd, sigset_t __user *, user_mask, | |||
311 | { | 312 | { |
312 | return sys_signalfd4(ufd, user_mask, sizemask, 0); | 313 | return sys_signalfd4(ufd, user_mask, sizemask, 0); |
313 | } | 314 | } |
315 | |||
316 | #ifdef CONFIG_COMPAT | ||
317 | COMPAT_SYSCALL_DEFINE4(signalfd4, int, ufd, | ||
318 | const compat_sigset_t __user *,sigmask, | ||
319 | compat_size_t, sigsetsize, | ||
320 | int, flags) | ||
321 | { | ||
322 | compat_sigset_t ss32; | ||
323 | sigset_t tmp; | ||
324 | sigset_t __user *ksigmask; | ||
325 | |||
326 | if (sigsetsize != sizeof(compat_sigset_t)) | ||
327 | return -EINVAL; | ||
328 | if (copy_from_user(&ss32, sigmask, sizeof(ss32))) | ||
329 | return -EFAULT; | ||
330 | sigset_from_compat(&tmp, &ss32); | ||
331 | ksigmask = compat_alloc_user_space(sizeof(sigset_t)); | ||
332 | if (copy_to_user(ksigmask, &tmp, sizeof(sigset_t))) | ||
333 | return -EFAULT; | ||
334 | |||
335 | return sys_signalfd4(ufd, ksigmask, sizeof(sigset_t), flags); | ||
336 | } | ||
337 | |||
338 | COMPAT_SYSCALL_DEFINE3(signalfd, int, ufd, | ||
339 | const compat_sigset_t __user *,sigmask, | ||
340 | compat_size_t, sigsetsize) | ||
341 | { | ||
342 | return compat_sys_signalfd4(ufd, sigmask, sigsetsize, 0); | ||
343 | } | ||
344 | #endif | ||