Commit 9e008c3c authored by Linus Torvalds's avatar Linus Torvalds

When forcing through a signal for some thread-synchronous

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.
parent b79c8524
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment