Skip to content

Commit

Permalink
pid_ns: zap_pid_ns_processes: use SEND_SIG_NOINFO instead of force_sig()
Browse files Browse the repository at this point in the history
zap_pid_ns_processes() uses force_sig(SIGKILL) to ensure SIGKILL will be
delivered to sub-namespace inits as well.  This is correct, but we are
going to change force_sig_info() semantics.  See
http://bugzilla.kernel.org/show_bug.cgi?id=15395#c31

We can use send_sig_info(SEND_SIG_NOINFO) instead, since
614c517 ("signals: SEND_SIG_NOINFO should
be considered as SI_FROMUSER()") SEND_SIG_NOINFO means "from user" and
therefore send_signal() will get the correct from_ancestor_ns = T flag.

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Acked-by: Serge Hallyn <serue@us.ibm.com>
Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
Acked-by: Roland McGrath <roland@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Oleg Nesterov authored and Linus Torvalds committed Mar 12, 2010
1 parent 6edb676 commit 13aa9a6
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions kernel/pid_namespace.c
Original file line number Diff line number Diff line change
Expand Up @@ -161,13 +161,12 @@ void zap_pid_ns_processes(struct pid_namespace *pid_ns)
rcu_read_lock();

/*
* Use force_sig() since it clears SIGNAL_UNKILLABLE ensuring
* any nested-container's init processes don't ignore the
* signal
* Any nested-container's init processes won't ignore the
* SEND_SIG_NOINFO signal, see send_signal()->si_fromuser().
*/
task = pid_task(find_vpid(nr), PIDTYPE_PID);
if (task)
force_sig(SIGKILL, task);
send_sig_info(SIGKILL, SEND_SIG_NOINFO, task);

rcu_read_unlock();

Expand Down

0 comments on commit 13aa9a6

Please sign in to comment.