]> git.hungrycats.org Git - linux/commitdiff
[ARM] Fix ARM signal handling.
authorRussell King <rmk@flint.arm.linux.org.uk>
Sun, 9 Nov 2003 23:03:30 +0000 (23:03 +0000)
committerRussell King <rmk@flint.arm.linux.org.uk>
Sun, 9 Nov 2003 23:03:30 +0000 (23:03 +0000)
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

index 9901b5d010a079d9eaa6ad8fd0d8febb2006b8c1..139603ee611f11481e703f01365d5d6a4a2a2aea 100644 (file)
@@ -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;
        }