aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorMatt Fleming <matt.fleming@intel.com>2012-05-10 20:58:03 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2012-05-21 23:52:34 -0400
commit7a076e4ff07ffc2c219285ec57aed8bdde86cb37 (patch)
treeefa78c6de9e44f312d0a5a1ed86e6df08e0a2175 /arch
parent60c597513ee93fc6a0b7f2cb83d0aa67d4204cf1 (diff)
ia64: 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> Cc: Tony Luck <tony.luck@intel.com> Cc: Fenghua Yu <fenghua.yu@intel.com> 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>
Diffstat (limited to 'arch')
-rw-r--r--arch/ia64/kernel/signal.c15
1 files changed, 2 insertions, 13 deletions
diff --git a/arch/ia64/kernel/signal.c b/arch/ia64/kernel/signal.c
index 7bdafc8788bd..7523501d3bc0 100644
--- a/arch/ia64/kernel/signal.c
+++ b/arch/ia64/kernel/signal.c
@@ -201,13 +201,7 @@ ia64_rt_sigreturn (struct sigscratch *scr)
201 goto give_sigsegv; 201 goto give_sigsegv;
202 202
203 sigdelsetmask(&set, ~_BLOCKABLE); 203 sigdelsetmask(&set, ~_BLOCKABLE);
204 204 set_current_blocked(&set);
205 spin_lock_irq(&current->sighand->siglock);
206 {
207 current->blocked = set;
208 recalc_sigpending();
209 }
210 spin_unlock_irq(&current->sighand->siglock);
211 205
212 if (restore_sigcontext(sc, scr)) 206 if (restore_sigcontext(sc, scr))
213 goto give_sigsegv; 207 goto give_sigsegv;
@@ -427,12 +421,7 @@ handle_signal (unsigned long sig, struct k_sigaction *ka, siginfo_t *info, sigse
427 if (!setup_frame(sig, ka, info, oldset, scr)) 421 if (!setup_frame(sig, ka, info, oldset, scr))
428 return 0; 422 return 0;
429 423
430 spin_lock_irq(&current->sighand->siglock); 424 block_sigmask(ka, sig);
431 sigorsets(&current->blocked, &current->blocked, &ka->sa.sa_mask);
432 if (!(ka->sa.sa_flags & SA_NODEFER))
433 sigaddset(&current->blocked, sig);
434 recalc_sigpending();
435 spin_unlock_irq(&current->sighand->siglock);
436 425
437 /* 426 /*
438 * Let tracing know that we've done the handler setup. 427 * Let tracing know that we've done the handler setup.