aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/signal.c
diff options
context:
space:
mode:
authorRoland McGrath <roland@redhat.com>2008-07-25 22:45:52 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-07-26 15:00:09 -0400
commit445a91d2fe3667fb8fc251433645f686933cf56a (patch)
tree496f0715ba3079f3bf98e9808480fe7f25872b16 /kernel/signal.c
parent35de254dc60f91004b3b5ebb1fc7b2c3093d6032 (diff)
tracehook: tracehook_consider_fatal_signal
This defines tracehook_consider_fatal_signal() has a fine-grained hook for deciding to skip the special cases for a fatal signal, as ptrace does. There is no change, only cleanup. Signed-off-by: Roland McGrath <roland@redhat.com> Cc: Oleg Nesterov <oleg@tv-sign.ru> Reviewed-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel/signal.c')
-rw-r--r--kernel/signal.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/kernel/signal.c b/kernel/signal.c
index 9efd1cee6d0b..1a942ce32ba0 100644
--- a/kernel/signal.c
+++ b/kernel/signal.c
@@ -300,12 +300,12 @@ flush_signal_handlers(struct task_struct *t, int force_default)
300 300
301int unhandled_signal(struct task_struct *tsk, int sig) 301int unhandled_signal(struct task_struct *tsk, int sig)
302{ 302{
303 void __user *handler = tsk->sighand->action[sig-1].sa.sa_handler;
303 if (is_global_init(tsk)) 304 if (is_global_init(tsk))
304 return 1; 305 return 1;
305 if (tsk->ptrace & PT_PTRACED) 306 if (handler != SIG_IGN && handler != SIG_DFL)
306 return 0; 307 return 0;
307 return (tsk->sighand->action[sig-1].sa.sa_handler == SIG_IGN) || 308 return !tracehook_consider_fatal_signal(tsk, sig, handler);
308 (tsk->sighand->action[sig-1].sa.sa_handler == SIG_DFL);
309} 309}
310 310
311 311
@@ -761,7 +761,8 @@ static void complete_signal(int sig, struct task_struct *p, int group)
761 if (sig_fatal(p, sig) && 761 if (sig_fatal(p, sig) &&
762 !(signal->flags & (SIGNAL_UNKILLABLE | SIGNAL_GROUP_EXIT)) && 762 !(signal->flags & (SIGNAL_UNKILLABLE | SIGNAL_GROUP_EXIT)) &&
763 !sigismember(&t->real_blocked, sig) && 763 !sigismember(&t->real_blocked, sig) &&
764 (sig == SIGKILL || !(t->ptrace & PT_PTRACED))) { 764 (sig == SIGKILL ||
765 !tracehook_consider_fatal_signal(t, sig, SIG_DFL))) {
765 /* 766 /*
766 * This signal will be fatal to the whole group. 767 * This signal will be fatal to the whole group.
767 */ 768 */