From e611653355cfcd94bad4bb10279bf3e75d0d19e2 Mon Sep 17 00:00:00 2001 From: Russell King Date: Sun, 9 Nov 2003 23:03:30 +0000 Subject: [PATCH] [ARM] Fix ARM signal handling. If we are unable to deliver a signal to the process (eg, due to stack pointer corruption) block the signal so other fatal signals can kill off the process. --- arch/arm/kernel/signal.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/arch/arm/kernel/signal.c b/arch/arm/kernel/signal.c index 9901b5d010a07..139603ee611f1 100644 --- a/arch/arm/kernel/signal.c +++ b/arch/arm/kernel/signal.c @@ -497,18 +497,21 @@ handle_signal(unsigned long sig, siginfo_t *info, sigset_t *oldset, */ ret |= !valid_user_regs(regs); + /* + * Block the signal if we were unsuccessful. + */ + if (ret != 0 || !(ka->sa.sa_flags & SA_NODEFER)) { + spin_lock_irq(&tsk->sighand->siglock); + sigorsets(&tsk->blocked, &tsk->blocked, + &ka->sa.sa_mask); + sigaddset(&tsk->blocked, sig); + recalc_sigpending(); + spin_unlock_irq(&tsk->sighand->siglock); + } + if (ret == 0) { if (ka->sa.sa_flags & SA_ONESHOT) ka->sa.sa_handler = SIG_DFL; - - if (!(ka->sa.sa_flags & SA_NODEFER)) { - spin_lock_irq(&tsk->sighand->siglock); - sigorsets(&tsk->blocked, &tsk->blocked, - &ka->sa.sa_mask); - sigaddset(&tsk->blocked, sig); - recalc_sigpending(); - spin_unlock_irq(&tsk->sighand->siglock); - } return; } -- 2.53.0