Skip to content

Commit

Permalink
[PATCH] sigkill priority fix
Browse files Browse the repository at this point in the history
If SIGKILL does not have priority, we cannot instantly kill task before it
makes some unexpected job.  It can be critical, but we were unable to
reproduce this easily until Heiko Carstens <Heiko.Carstens@de.ibm.com>
reported this problem on LKML.

Signed-Off-By: Kirill Korotaev <dev@sw.ru>
Signed-Off-By: Alexey Kuznetsov <kuznet@ms2.inr.ac.ru>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Kirill Korotaev authored and Linus Torvalds committed May 25, 2005
1 parent 6431e6a commit c33880a
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion kernel/signal.c
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,16 @@ static int __dequeue_signal(struct sigpending *pending, sigset_t *mask,
{
int sig = 0;

sig = next_signal(pending, mask);
/* SIGKILL must have priority, otherwise it is quite easy
* to create an unkillable process, sending sig < SIGKILL
* to self */
if (unlikely(sigismember(&pending->signal, SIGKILL))) {
if (!sigismember(mask, SIGKILL))
sig = SIGKILL;
}

if (likely(!sig))
sig = next_signal(pending, mask);
if (sig) {
if (current->notifier) {
if (sigismember(current->notifier_mask, sig)) {
Expand Down

0 comments on commit c33880a

Please sign in to comment.