diff options
Diffstat (limited to 'arch/parisc/kernel/signal32.c')
-rw-r--r-- | arch/parisc/kernel/signal32.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/arch/parisc/kernel/signal32.c b/arch/parisc/kernel/signal32.c index 5dede04f2f3e..2ddcabb616ce 100644 --- a/arch/parisc/kernel/signal32.c +++ b/arch/parisc/kernel/signal32.c | |||
@@ -65,7 +65,7 @@ put_sigset32(compat_sigset_t __user *up, sigset_t *set, size_t sz) | |||
65 | { | 65 | { |
66 | compat_sigset_t s; | 66 | compat_sigset_t s; |
67 | 67 | ||
68 | if (sz != sizeof *set) | 68 | if (sz != sizeof(compat_sigset_t)) |
69 | return -EINVAL; | 69 | return -EINVAL; |
70 | sigset_64to32(&s, set); | 70 | sigset_64to32(&s, set); |
71 | 71 | ||
@@ -78,7 +78,7 @@ get_sigset32(compat_sigset_t __user *up, sigset_t *set, size_t sz) | |||
78 | compat_sigset_t s; | 78 | compat_sigset_t s; |
79 | int r; | 79 | int r; |
80 | 80 | ||
81 | if (sz != sizeof *set) | 81 | if (sz != sizeof(compat_sigset_t)) |
82 | return -EINVAL; | 82 | return -EINVAL; |
83 | 83 | ||
84 | if ((r = copy_from_user(&s, up, sz)) == 0) { | 84 | if ((r = copy_from_user(&s, up, sz)) == 0) { |
@@ -94,8 +94,11 @@ int sys32_rt_sigprocmask(int how, compat_sigset_t __user *set, compat_sigset_t _ | |||
94 | sigset_t old_set, new_set; | 94 | sigset_t old_set, new_set; |
95 | int ret; | 95 | int ret; |
96 | 96 | ||
97 | if (set && get_sigset32(set, &new_set, sigsetsize)) | 97 | if (set) { |
98 | return -EFAULT; | 98 | ret = get_sigset32(set, &new_set, sigsetsize); |
99 | if (ret) | ||
100 | return ret; | ||
101 | } | ||
99 | 102 | ||
100 | KERNEL_SYSCALL(ret, sys_rt_sigprocmask, how, set ? (sigset_t __user *)&new_set : NULL, | 103 | KERNEL_SYSCALL(ret, sys_rt_sigprocmask, how, set ? (sigset_t __user *)&new_set : NULL, |
101 | oset ? (sigset_t __user *)&old_set : NULL, sigsetsize); | 104 | oset ? (sigset_t __user *)&old_set : NULL, sigsetsize); |
@@ -128,6 +131,10 @@ sys32_rt_sigaction(int sig, const struct sigaction32 __user *act, struct sigacti | |||
128 | struct k_sigaction new_sa, old_sa; | 131 | struct k_sigaction new_sa, old_sa; |
129 | int ret = -EINVAL; | 132 | int ret = -EINVAL; |
130 | 133 | ||
134 | /* XXX: Don't preclude handling different sized sigset_t's. */ | ||
135 | if (sigsetsize != sizeof(compat_sigset_t)) | ||
136 | return -EINVAL; | ||
137 | |||
131 | if (act) { | 138 | if (act) { |
132 | if (copy_from_user(&new_sa32.sa, act, sizeof new_sa32.sa)) | 139 | if (copy_from_user(&new_sa32.sa, act, sizeof new_sa32.sa)) |
133 | return -EFAULT; | 140 | return -EFAULT; |