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

parisc: fix error return codes for rt_sigaction and rt_sigprocmask

Signed-off-by: Helge Deller <deller@gmx.de>

+11 -4
+11 -4
arch/parisc/kernel/signal32.c
··· 65 65 { 66 66 compat_sigset_t s; 67 67 68 - if (sz != sizeof *set) 68 + if (sz != sizeof(compat_sigset_t)) 69 69 return -EINVAL; 70 70 sigset_64to32(&s, set); 71 71 ··· 78 78 compat_sigset_t s; 79 79 int r; 80 80 81 - if (sz != sizeof *set) 81 + if (sz != sizeof(compat_sigset_t)) 82 82 return -EINVAL; 83 83 84 84 if ((r = copy_from_user(&s, up, sz)) == 0) { ··· 94 94 sigset_t old_set, new_set; 95 95 int ret; 96 96 97 - if (set && get_sigset32(set, &new_set, sigsetsize)) 98 - return -EFAULT; 97 + if (set) { 98 + ret = get_sigset32(set, &new_set, sigsetsize); 99 + if (ret) 100 + return ret; 101 + } 99 102 100 103 KERNEL_SYSCALL(ret, sys_rt_sigprocmask, how, set ? (sigset_t __user *)&new_set : NULL, 101 104 oset ? (sigset_t __user *)&old_set : NULL, sigsetsize); ··· 130 127 struct k_sigaction32 new_sa32, old_sa32; 131 128 struct k_sigaction new_sa, old_sa; 132 129 int ret = -EINVAL; 130 + 131 + /* XXX: Don't preclude handling different sized sigset_t's. */ 132 + if (sigsetsize != sizeof(compat_sigset_t)) 133 + return -EINVAL; 133 134 134 135 if (act) { 135 136 if (copy_from_user(&new_sa32.sa, act, sizeof new_sa32.sa))