summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOleg Nesterov <oleg@tv-sign.ru>2008-04-30 00:53:05 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2008-04-30 08:29:37 -0700
commit80fe728d593e3a048a56610de932919f7d6d968a (patch)
treeff8effec1d05d871bcbb1347947d2a0970a8ff32
parent7a5e873f096e04e6d8719e4ecb7b70d2decca503 (diff)
downloadlinux-3.10-80fe728d593e3a048a56610de932919f7d6d968a.tar.gz
linux-3.10-80fe728d593e3a048a56610de932919f7d6d968a.tar.bz2
linux-3.10-80fe728d593e3a048a56610de932919f7d6d968a.zip
signals: allow the kernel to actually kill /sbin/init
Currently the buggy /sbin/init hangs if SIGSEGV/etc happens. The kernel sends the signal, init dequeues it and ignores, returns from the exception, repeats the faulting instruction, and so on forever. Imho, such a behaviour is not good. I think that the explicit loud death of the buggy /sbin/init is better than the silent hang. Change force_sig_info() to clear SIGNAL_UNKILLABLE when the task should be really killed. Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru> Cc: Roland McGrath <roland@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
-rw-r--r--kernel/signal.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/kernel/signal.c b/kernel/signal.c
index 646a8765696..9ac737e53df 100644
--- a/kernel/signal.c
+++ b/kernel/signal.c
@@ -892,7 +892,8 @@ specific_send_sig_info(int sig, struct siginfo *info, struct task_struct *t)
* since we do not want to have a signal handler that was blocked
* be invoked when user space had explicitly blocked it.
*
- * We don't want to have recursive SIGSEGV's etc, for example.
+ * We don't want to have recursive SIGSEGV's etc, for example,
+ * that is why we also clear SIGNAL_UNKILLABLE.
*/
int
force_sig_info(int sig, struct siginfo *info, struct task_struct *t)
@@ -912,6 +913,8 @@ force_sig_info(int sig, struct siginfo *info, struct task_struct *t)
recalc_sigpending_and_wake(t);
}
}
+ if (action->sa.sa_handler == SIG_DFL)
+ t->signal->flags &= ~SIGNAL_UNKILLABLE;
ret = specific_send_sig_info(sig, info, t);
spin_unlock_irqrestore(&t->sighand->siglock, flags);