All of lore.kernel.org
 help / color / mirror / Atom feed
From: Oleg Nesterov <oleg@redhat.com>
To: Andrew Morton <akpm@linux-foundation.org>,
	"Eric W. Biederman" <ebiederm@xmission.com>
Cc: security@kernel.org, "Robert O'Callahan" <robert@ocallahan.org>,
	Kees Cook <keescook@chromium.org>,
	Andy Lutomirski <luto@kernel.org>,
	Dmitry Vyukov <dvyukov@google.com>, Kyle Huey <me@kylehuey.com>,
	linux-kernel@vger.kernel.org
Subject: [PATCH 2/3] protect the SIGNAL_UNKILLABLE tasks from !sig_kernel_only() signals
Date: Fri, 3 Nov 2017 19:42:27 +0100	[thread overview]
Message-ID: <20171103184227.GC21036@redhat.com> (raw)
In-Reply-To: <20171103184144.GA21036@redhat.com>

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.

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
---
 kernel/signal.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/signal.c b/kernel/signal.c
index b9aebe1..8fc0182 100644
--- a/kernel/signal.c
+++ b/kernel/signal.c
@@ -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);
-- 
2.5.0

  parent reply	other threads:[~2017-11-03 18:42 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAP045Ap9Xv67GaeskDt_gAajp1Cni_S0Z0u_vsuw_ptRUuJD6Q@mail.gmail.com>
     [not found] ` <20171102160705.GA11973@redhat.com>
2017-11-03 18:41   ` [PATCH 0/3] fix SIGNAL_UNKILLABLE && SIGKILL interaction Oleg Nesterov
2017-11-03 18:42     ` [PATCH 1/3] protect the traced SIGNAL_UNKILLABLE tasks from SIGKILL Oleg Nesterov
2017-11-03 18:42     ` Oleg Nesterov [this message]
2017-11-03 18:42     ` [PATCH 3/3] remove the no longer needed SIGNAL_UNKILLABLE check in complete_signal() Oleg Nesterov
2017-11-03 19:14       ` Kees Cook
2017-11-13 14:53     ` [PATCH 0/3] fix SIGNAL_UNKILLABLE && SIGKILL interaction Oleg Nesterov
2017-11-13 20:00       ` Kyle Huey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20171103184227.GC21036@redhat.com \
    --to=oleg@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=dvyukov@google.com \
    --cc=ebiederm@xmission.com \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=me@kylehuey.com \
    --cc=robert@ocallahan.org \
    --cc=security@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.