lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 4 Mar 2010 01:20:07 -0600
From:	"Serge E. Hallyn" <serue@...ibm.com>
To:	Oleg Nesterov <oleg@...hat.com>
Cc:	Andrew Morton <akpm@...ux-foundation.org>,
	Roland McGrath <roland@...hat.com>, wylda@...ny.cz,
	gregkh@...e.de, jkosina@...e.cz,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	Sukadev Bhattiprolu <sukadev@...ibm.com>,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] pid_ns: zap_pid_ns_processes: use SEND_SIG_NOINFO
 instead	of force_sig()

Quoting Oleg Nesterov (oleg@...hat.com):
> 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
> 614c517d7c00af1b26ded20646b329397d6f51a1 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@...hat.com>

Justification makes sense, and (in some superficial testing, killing some
nested pid_ns's) the patch seems to do the right thing.

Acked-by: Serge Hallyn <serue@...ibm.com>

> ---
> 
>  kernel/pid_namespace.c |    7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
> 
> --- mm/kernel/pid_namespace.c~NS_DONT_ABUSE_FORCE	2010-02-25 15:22:13.000000000 +0100
> +++ mm/kernel/pid_namespace.c	2010-03-03 20:58:12.000000000 +0100
> @@ -161,13 +161,12 @@ void zap_pid_ns_processes(struct pid_nam
>  		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();
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ