]> git.neil.brown.name Git - history.git/commitdiff
When forcing through a signal for some thread-synchronous
authorLinus Torvalds <torvalds@home.osdl.org>
Fri, 4 Jul 2003 10:53:27 +0000 (03:53 -0700)
committerLinus Torvalds <torvalds@home.osdl.org>
Fri, 4 Jul 2003 10:53:27 +0000 (03:53 -0700)
event (ie SIGSEGV, SIGFPE etc that happens as a result of a
trap as opposed to an external event), if the signal is
blocked we will not invoce a signal handler, we will just
kill the thread with the signal.

This is equivalent to what we do in the SIG_IGN case: you
cannot ignore or block synchronous signals, and if you try,
we'll just have to kill you.

We don't want to handle endless recursive faults, which the
old behaviour easily led to if the stack was bad, for example.

kernel/signal.c

index 78c4dfa0073c61fb5d7e3c151334f747b9c6adde..4768ea5bab229559fc2bea14e4c3c5fe281b274b 100644 (file)
@@ -797,10 +797,11 @@ force_sig_info(int sig, struct siginfo *info, struct task_struct *t)
        int ret;
 
        spin_lock_irqsave(&t->sighand->siglock, flags);
-       if (t->sighand->action[sig-1].sa.sa_handler == SIG_IGN)
+       if (sigismember(&t->blocked, sig) || t->sighand->action[sig-1].sa.sa_handler == SIG_IGN) {
                t->sighand->action[sig-1].sa.sa_handler = SIG_DFL;
-       sigdelset(&t->blocked, sig);
-       recalc_sigpending_tsk(t);
+               sigdelset(&t->blocked, sig);
+               recalc_sigpending_tsk(t);
+       }
        ret = specific_send_sig_info(sig, info, t);
        spin_unlock_irqrestore(&t->sighand->siglock, flags);