diff options
Diffstat (limited to 'arch/powerpc/kernel/signal_32.c')
-rw-r--r-- | arch/powerpc/kernel/signal_32.c | 22 |
1 files changed, 8 insertions, 14 deletions
diff --git a/arch/powerpc/kernel/signal_32.c b/arch/powerpc/kernel/signal_32.c index 3747ab0dac3f..bd837b5dbf06 100644 --- a/arch/powerpc/kernel/signal_32.c +++ b/arch/powerpc/kernel/signal_32.c | |||
@@ -142,11 +142,7 @@ static inline int get_old_sigaction(struct k_sigaction *new_ka, | |||
142 | return 0; | 142 | return 0; |
143 | } | 143 | } |
144 | 144 | ||
145 | static inline compat_uptr_t to_user_ptr(void *kp) | 145 | #define to_user_ptr(p) ptr_to_compat(p) |
146 | { | ||
147 | return (compat_uptr_t)(u64)kp; | ||
148 | } | ||
149 | |||
150 | #define from_user_ptr(p) compat_ptr(p) | 146 | #define from_user_ptr(p) compat_ptr(p) |
151 | 147 | ||
152 | static inline int save_general_regs(struct pt_regs *regs, | 148 | static inline int save_general_regs(struct pt_regs *regs, |
@@ -213,8 +209,8 @@ static inline int get_old_sigaction(struct k_sigaction *new_ka, | |||
213 | return 0; | 209 | return 0; |
214 | } | 210 | } |
215 | 211 | ||
216 | #define to_user_ptr(p) (p) | 212 | #define to_user_ptr(p) ((unsigned long)(p)) |
217 | #define from_user_ptr(p) (p) | 213 | #define from_user_ptr(p) ((void __user *)(p)) |
218 | 214 | ||
219 | static inline int save_general_regs(struct pt_regs *regs, | 215 | static inline int save_general_regs(struct pt_regs *regs, |
220 | struct mcontext __user *frame) | 216 | struct mcontext __user *frame) |
@@ -254,11 +250,9 @@ int do_signal(sigset_t *oldset, struct pt_regs *regs); | |||
254 | */ | 250 | */ |
255 | long sys_sigsuspend(old_sigset_t mask) | 251 | long sys_sigsuspend(old_sigset_t mask) |
256 | { | 252 | { |
257 | sigset_t saveset; | ||
258 | |||
259 | mask &= _BLOCKABLE; | 253 | mask &= _BLOCKABLE; |
260 | spin_lock_irq(¤t->sighand->siglock); | 254 | spin_lock_irq(¤t->sighand->siglock); |
261 | saveset = current->blocked; | 255 | current->saved_sigmask = current->blocked; |
262 | siginitset(¤t->blocked, mask); | 256 | siginitset(¤t->blocked, mask); |
263 | recalc_sigpending(); | 257 | recalc_sigpending(); |
264 | spin_unlock_irq(¤t->sighand->siglock); | 258 | spin_unlock_irq(¤t->sighand->siglock); |
@@ -528,7 +522,7 @@ long compat_sys_rt_sigaction(int sig, const struct sigaction32 __user *act, | |||
528 | 522 | ||
529 | ret = do_sigaction(sig, act ? &new_ka : NULL, oact ? &old_ka : NULL); | 523 | ret = do_sigaction(sig, act ? &new_ka : NULL, oact ? &old_ka : NULL); |
530 | if (!ret && oact) { | 524 | if (!ret && oact) { |
531 | ret = put_user((long)old_ka.sa.sa_handler, &oact->sa_handler); | 525 | ret = put_user(to_user_ptr(old_ka.sa.sa_handler), &oact->sa_handler); |
532 | ret |= put_sigset_t(&oact->sa_mask, &old_ka.sa.sa_mask); | 526 | ret |= put_sigset_t(&oact->sa_mask, &old_ka.sa.sa_mask); |
533 | ret |= __put_user(old_ka.sa.sa_flags, &oact->sa_flags); | 527 | ret |= __put_user(old_ka.sa.sa_flags, &oact->sa_flags); |
534 | } | 528 | } |
@@ -677,8 +671,8 @@ long compat_sys_rt_sigqueueinfo(u32 pid, u32 sig, compat_siginfo_t __user *uinfo | |||
677 | int compat_sys_sigaltstack(u32 __new, u32 __old, int r5, | 671 | int compat_sys_sigaltstack(u32 __new, u32 __old, int r5, |
678 | int r6, int r7, int r8, struct pt_regs *regs) | 672 | int r6, int r7, int r8, struct pt_regs *regs) |
679 | { | 673 | { |
680 | stack_32_t __user * newstack = (stack_32_t __user *)(long) __new; | 674 | stack_32_t __user * newstack = compat_ptr(__new); |
681 | stack_32_t __user * oldstack = (stack_32_t __user *)(long) __old; | 675 | stack_32_t __user * oldstack = compat_ptr(__old); |
682 | stack_t uss, uoss; | 676 | stack_t uss, uoss; |
683 | int ret; | 677 | int ret; |
684 | mm_segment_t old_fs; | 678 | mm_segment_t old_fs; |
@@ -710,7 +704,7 @@ int compat_sys_sigaltstack(u32 __new, u32 __old, int r5, | |||
710 | set_fs(old_fs); | 704 | set_fs(old_fs); |
711 | /* Copy the stack information to the user output buffer */ | 705 | /* Copy the stack information to the user output buffer */ |
712 | if (!ret && oldstack && | 706 | if (!ret && oldstack && |
713 | (put_user((long)uoss.ss_sp, &oldstack->ss_sp) || | 707 | (put_user(ptr_to_compat(uoss.ss_sp), &oldstack->ss_sp) || |
714 | __put_user(uoss.ss_flags, &oldstack->ss_flags) || | 708 | __put_user(uoss.ss_flags, &oldstack->ss_flags) || |
715 | __put_user(uoss.ss_size, &oldstack->ss_size))) | 709 | __put_user(uoss.ss_size, &oldstack->ss_size))) |
716 | return -EFAULT; | 710 | return -EFAULT; |