aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Fleming <matt.fleming@intel.com>2012-05-10 20:58:58 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2012-05-21 23:52:31 -0400
commitade7728b4e9aac4cc82117e3e35c5745b7d16037 (patch)
tree130ae23812b27cfffb650c87c0116c8eac90fd02
parent68f3f16d9ad0f1e28ab3fd0001ab5798c41f15a3 (diff)
parisc: use set_current_blocked() and block_sigmask()
As described in e6fa16ab ("signal: sigprocmask() should do retarget_shared_pending()") the modification of current->blocked is incorrect as we need to check whether the signal we're about to block is pending in the shared queue. Also, use the new helper function introduced in commit 5e6292c0f28f ("signal: add block_sigmask() for adding sigmask to current->blocked") which centralises the code for updating current->blocked after successfully delivering a signal and reduces the amount of duplicate code across architectures. In the past some architectures got this code wrong, so using this helper function should stop that from happening again. Acked-by: Oleg Nesterov <oleg@redhat.com> Acked-by: Kyle McMartin <kyle@mcmartin.ca> Cc: Helge Deller <deller@gmx.de> Cc: "James E.J. Bottomley" <jejb@parisc-linux.org> Signed-off-by: Matt Fleming <matt.fleming@intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r--arch/parisc/kernel/signal.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/arch/parisc/kernel/signal.c b/arch/parisc/kernel/signal.c
index 12c1ed33dc18..bd36152b780e 100644
--- a/arch/parisc/kernel/signal.c
+++ b/arch/parisc/kernel/signal.c
@@ -131,10 +131,7 @@ sys_rt_sigreturn(struct pt_regs *regs, int in_syscall)
131 } 131 }
132 132
133 sigdelsetmask(&set, ~_BLOCKABLE); 133 sigdelsetmask(&set, ~_BLOCKABLE);
134 spin_lock_irq(&current->sighand->siglock); 134 set_current_blocked(&set);
135 current->blocked = set;
136 recalc_sigpending();
137 spin_unlock_irq(&current->sighand->siglock);
138 135
139 /* Good thing we saved the old gr[30], eh? */ 136 /* Good thing we saved the old gr[30], eh? */
140#ifdef CONFIG_64BIT 137#ifdef CONFIG_64BIT
@@ -454,12 +451,7 @@ handle_signal(unsigned long sig, siginfo_t *info, struct k_sigaction *ka,
454 if (!setup_rt_frame(sig, ka, info, oldset, regs, in_syscall)) 451 if (!setup_rt_frame(sig, ka, info, oldset, regs, in_syscall))
455 return 0; 452 return 0;
456 453
457 spin_lock_irq(&current->sighand->siglock); 454 block_sigmask(ka, sig);
458 sigorsets(&current->blocked,&current->blocked,&ka->sa.sa_mask);
459 if (!(ka->sa.sa_flags & SA_NODEFER))
460 sigaddset(&current->blocked,sig);
461 recalc_sigpending();
462 spin_unlock_irq(&current->sighand->siglock);
463 455
464 tracehook_signal_handler(sig, info, ka, regs, 456 tracehook_signal_handler(sig, info, ka, regs,
465 test_thread_flag(TIF_SINGLESTEP) || 457 test_thread_flag(TIF_SINGLESTEP) ||