Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

[PATCH] sigkill priority fix

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>

authored by

Kirill Korotaev and committed by
Linus Torvalds
c33880aa 6431e6a2

+10 -1
+10 -1
kernel/signal.c
··· 522 522 { 523 523 int sig = 0; 524 524 525 - sig = next_signal(pending, mask); 525 + /* SIGKILL must have priority, otherwise it is quite easy 526 + * to create an unkillable process, sending sig < SIGKILL 527 + * to self */ 528 + if (unlikely(sigismember(&pending->signal, SIGKILL))) { 529 + if (!sigismember(mask, SIGKILL)) 530 + sig = SIGKILL; 531 + } 532 + 533 + if (likely(!sig)) 534 + sig = next_signal(pending, mask); 526 535 if (sig) { 527 536 if (current->notifier) { 528 537 if (sigismember(current->notifier_mask, sig)) {