kernel/signal.c: protect the SIGNAL_UNKILLABLE tasks from !sig_kernel_only() signals
authorOleg Nesterov <oleg@redhat.com>
Fri, 17 Nov 2017 23:30:04 +0000 (15:30 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sat, 18 Nov 2017 00:10:03 +0000 (16:10 -0800)
Change sig_task_ignored() to drop the SIG_DFL && !sig_kernel_only()
signals even if force == T.  This simplifies the next change and this
matches the same check in get_signal() which will drop these signals
anyway.

Link: http://lkml.kernel.org/r/20171103184227.GC21036@redhat.com
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Tested-by: Kyle Huey <me@kylehuey.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
kernel/signal.c

index be59131..01ba166 100644 (file)
@@ -78,7 +78,7 @@ static int sig_task_ignored(struct task_struct *t, int sig, bool force)
        handler = sig_handler(t, sig);
 
        if (unlikely(t->signal->flags & SIGNAL_UNKILLABLE) &&
-                       handler == SIG_DFL && !force)
+           handler == SIG_DFL && !(force && sig_kernel_only(sig)))
                return 1;
 
        return sig_handler_ignored(handler, sig);