aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel
diff options
context:
space:
mode:
authorOleg Nesterov <oleg@redhat.com>2011-04-27 15:04:28 -0400
committerOleg Nesterov <oleg@redhat.com>2011-04-28 07:01:37 -0400
commite6a585801b451443480ff66914a522b482457460 (patch)
treeccca18b6b587244b1400af5c1c6e20fee8483b7a /arch/x86/kernel
parente6fa16ab9c1e9b344428e6fea4d29e3cc4b28fb0 (diff)
x86: signal: handle_signal() should use set_current_blocked()
This is ugly, but if sigprocmask() needs retarget_shared_pending() then handle signal should follow this logic. In theory it is newer correct to add the new signals to current->blocked, the signal handler can sleep/etc so we should notify other threads in case we block the pending signal and nobody else has TIF_SIGPENDING. Of course, this change doesn't make signals faster :/ Signed-off-by: Oleg Nesterov <oleg@redhat.com> Reviewed-by: Matt Fleming <matt.fleming@linux.intel.com> Acked-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'arch/x86/kernel')
-rw-r--r--arch/x86/kernel/signal.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/arch/x86/kernel/signal.c b/arch/x86/kernel/signal.c
index 4fd173cd8e57..5a8f5e68bb61 100644
--- a/arch/x86/kernel/signal.c
+++ b/arch/x86/kernel/signal.c
@@ -682,6 +682,7 @@ static int
682handle_signal(unsigned long sig, siginfo_t *info, struct k_sigaction *ka, 682handle_signal(unsigned long sig, siginfo_t *info, struct k_sigaction *ka,
683 sigset_t *oldset, struct pt_regs *regs) 683 sigset_t *oldset, struct pt_regs *regs)
684{ 684{
685 sigset_t blocked;
685 int ret; 686 int ret;
686 687
687 /* Are we from a system call? */ 688 /* Are we from a system call? */
@@ -741,12 +742,10 @@ handle_signal(unsigned long sig, siginfo_t *info, struct k_sigaction *ka,
741 */ 742 */
742 regs->flags &= ~X86_EFLAGS_TF; 743 regs->flags &= ~X86_EFLAGS_TF;
743 744
744 spin_lock_irq(&current->sighand->siglock); 745 sigorsets(&blocked, &current->blocked, &ka->sa.sa_mask);
745 sigorsets(&current->blocked, &current->blocked, &ka->sa.sa_mask);
746 if (!(ka->sa.sa_flags & SA_NODEFER)) 746 if (!(ka->sa.sa_flags & SA_NODEFER))
747 sigaddset(&current->blocked, sig); 747 sigaddset(&blocked, sig);
748 recalc_sigpending(); 748 set_current_blocked(&blocked);
749 spin_unlock_irq(&current->sighand->siglock);
750 749
751 tracehook_signal_handler(sig, info, ka, regs, 750 tracehook_signal_handler(sig, info, ka, regs,
752 test_thread_flag(TIF_SINGLESTEP)); 751 test_thread_flag(TIF_SINGLESTEP));