mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Oleg Nesterov <oleg@redhat.com>
To: Andrew Morton <akpm@linux-foundation.org>,
	Dmitry Vyukov <dvyukov@google.com>
Cc: Roland McGrath <roland@hack.frob.com>,
	amanieu@gmail.com, pmoore@redhat.com,
	Ingo Molnar <mingo@kernel.org>,
	vdavydov@parallels.com, qiaowei.ren@intel.com, dave@stgolabs.net,
	palmer@dabbelt.com, syzkaller <syzkaller@googlegroups.com>,
	Kostya Serebryany <kcc@google.com>,
	Alexander Potapenko <glider@google.com>,
	Sasha Levin <sasha.levin@oracle.com>,
	linux-kernel@vger.kernel.org
Subject: [PATCH v2 1/3] signal: change sig_task_ignored(force) to take sig_kernel_only() into account
Date: Thu, 5 Nov 2015 21:17:36 +0100	[thread overview]
Message-ID: <20151105201736.GA15782@redhat.com> (raw)
In-Reply-To: <20151105201720.GA15763@redhat.com>

sig_task_ignored(force => true) returns false unless sig_kernel_ignore().
This makes no sense if !sig_kernel_only(), the signal will be dropped in
get_signal() anyway.

This patch simplifies the next change and allows us to do more cleanups,
in particular we can unify the SIGNAL_UNKILLABLE/sig_kernel_only() check
in sig_task_ignored() and get_signal().

The user-visible change is that, since we drop the SIG_DFL signal early,
it won't be reported to debugger. I think this is fine, but probably we
will change this later, we need to fix this logic anyway. Currently we
rely on the fact that (say) send_sigtrap() uses force_sig_info() which
clears SIGNAL_UNKILLABLE, and this is really bad.

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

diff --git a/kernel/signal.c b/kernel/signal.c
index d64efad..87209e5 100644
--- a/kernel/signal.c
+++ b/kernel/signal.c
@@ -72,7 +72,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);
-- 
1.5.5.1


  reply	other threads:[~2015-11-05 19:21 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-05 20:17 [PATCH 0/3] signal: kill the obsolete SIGNAL_UNKILLABLE check in complete_signal() Oleg Nesterov
2015-11-05 20:17 ` Oleg Nesterov [this message]
2015-11-05 20:17 ` [PATCH v2 2/3] " Oleg Nesterov
2015-11-05 20:17 ` [PATCH v2 3/3] signal: change complete_signal() to use for_each_thread() Oleg Nesterov
2015-11-05 23:33 ` [PATCH 0/3] signal: kill the obsolete SIGNAL_UNKILLABLE check in complete_signal() Andrew Morton
2015-11-06 14:32   ` Oleg Nesterov
2015-11-06 19:16     ` Oleg Nesterov

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=20151105201736.GA15782@redhat.com \
    --to=oleg@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=amanieu@gmail.com \
    --cc=dave@stgolabs.net \
    --cc=dvyukov@google.com \
    --cc=glider@google.com \
    --cc=kcc@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=palmer@dabbelt.com \
    --cc=pmoore@redhat.com \
    --cc=qiaowei.ren@intel.com \
    --cc=roland@hack.frob.com \
    --cc=sasha.levin@oracle.com \
    --cc=syzkaller@googlegroups.com \
    --cc=vdavydov@parallels.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome