From: Oleg Nesterov <oleg@redhat.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Anton Vorontsov <anton.vorontsov@linaro.org>,
"Eric W. Biederman" <ebiederm@xmission.com>,
Greg KH <gregkh@linuxfoundation.org>,
KOSAKI Motohiro <kosaki.motohiro@gmail.com>,
Tejun Heo <tj@kernel.org>,
linux-kernel@vger.kernel.org
Subject: [PATCH 1/4] signal: give SEND_SIG_FORCED more power to beat SIGNAL_UNKILLABLE
Date: Fri, 10 Feb 2012 21:00:21 +0100 [thread overview]
Message-ID: <20120210200021.GA20898@redhat.com> (raw)
In-Reply-To: <20120210200004.GA20890@redhat.com>
force_sig_info() and friends have the special semantics for
synchronous signals, this interface should not be used if the
target is not current. And it needs the fixes, in particular
the clearing of SIGNAL_UNKILLABLE is not exactly right.
However there are callers which have to use force_ exactly because
it clears SIGNAL_UNKILLABLE and thus it can kill the CLONE_NEWPID
tasks, although this is almost always is wrong by various reasons.
With this patch SEND_SIG_FORCED ignores SIGNAL_UNKILLABLE, like
we do if the signal comes from the ancestor namespace.
This makes the naming in prepare_signal() paths insane, fixed by
the next cleanup.
Note: this only affects SIGKILL/SIGSTOP, but this is enough for
force_sig() abusers.
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
---
kernel/signal.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/kernel/signal.c b/kernel/signal.c
index c73c428..bfb2b97 100644
--- a/kernel/signal.c
+++ b/kernel/signal.c
@@ -1059,7 +1059,8 @@ static int __send_signal(int sig, struct siginfo *info, struct task_struct *t,
assert_spin_locked(&t->sighand->siglock);
- if (!prepare_signal(sig, t, from_ancestor_ns))
+ if (!prepare_signal(sig, t,
+ from_ancestor_ns || (info == SEND_SIG_FORCED)))
return 0;
pending = group ? &t->signal->shared_pending : &t->pending;
--
1.5.5.1
next prev parent reply other threads:[~2012-02-10 20:06 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-10 20:00 [PATCH 0/4] signal: force_sig cleanups Oleg Nesterov
2012-02-10 20:00 ` Oleg Nesterov [this message]
2012-02-10 21:25 ` [PATCH 1/4] signal: give SEND_SIG_FORCED more power to beat SIGNAL_UNKILLABLE Tejun Heo
2012-02-14 17:45 ` Oleg Nesterov
2012-02-14 17:53 ` Tejun Heo
2012-02-10 20:00 ` [PATCH 2/4] signal: cosmetic, s/from_ancestor_ns/force/ in prepare_signal() paths Oleg Nesterov
2012-02-10 20:00 ` [PATCH 3/4] signal: oom_kill_task: use SEND_SIG_FORCED instead of force_sig() Oleg Nesterov
2012-02-13 16:49 ` KOSAKI Motohiro
2012-02-10 20:01 ` [PATCH 4/4] signal: zap_pid_ns_processes: s/SEND_SIG_NOINFO/SEND_SIG_FORCED/ 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=20120210200021.GA20898@redhat.com \
--to=oleg@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=anton.vorontsov@linaro.org \
--cc=ebiederm@xmission.com \
--cc=gregkh@linuxfoundation.org \
--cc=kosaki.motohiro@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=tj@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).