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]
Message-ID: <alpine.DEB.2.00.1109230204270.29350@chino.kir.corp.google.com>
Date:	Fri, 23 Sep 2011 02:12:57 -0700 (PDT)
From:	David Rientjes <rientjes@...gle.com>
To:	Mike Galbraith <mgalbraith@...e.de>, Tejun Heo <htejun@...il.com>
cc:	Li Zefan <lizf@...fujitsu.com>,
	LKML <linux-kernel@...r.kernel.org>,
	Paul Menage <paul@...lmenage.org>
Subject: Re: [patch] cpusets: allow PF_THREAD_BOUND kworkers to escape from
 a cpuset

On Fri, 23 Sep 2011, Mike Galbraith wrote:

> Done, your ACK added as well.
> 
> kworkers can be born in a cpuset, leaving them adrift on an unsinkable ship.
> Allow them to be moved to the root cpuset so the cpuset can be destroyed.
> 

Thanks Li for the cc since I introduced this flag.

Does this even work?

You've modified cpuset_can_attach() to allow the attach for the cgroup 
interface, but the actual function that attaches the task in the cpuset 
code should fail since it does set_cpus_allowed_ptr() which should return 
-EINVAL because of the PF_THREAD_BOUND.  That should have emitted a 
WARN_ON() if this patch was tested.

kworkers can always move themselves to the root cpuset, so that's probably 
the better way of handling this than requiring userspace to do so.

And it seems like the workqueue code has a comment specifically about cpu 
hotplug and why changing their cpumask shouldn't be allowed that was added 
by Tejun Heo in db7bccf45cb8 ("workqueue: reimplement CPU hotplugging 
support using trustee").  So let's cc him here as well at his 
non-kernel.org address.

> Signed-off-by: Mike Galbraith <efault@....de>
> Acked-by: Li Zefan <lizf@...fujitsu.com>
> 
> diff --git a/kernel/cpuset.c b/kernel/cpuset.c
> index 10131fd..b26f4c4 100644
> --- a/kernel/cpuset.c
> +++ b/kernel/cpuset.c
> @@ -1384,7 +1384,7 @@ static int cpuset_can_attach(struct cgroup_subsys *ss, struct cgroup *cont,
>  	 * set_cpus_allowed_ptr() on all attached tasks before cpus_allowed may
>  	 * be changed.
>  	 */
> -	if (tsk->flags & PF_THREAD_BOUND)
> +	if (tsk->flags & PF_THREAD_BOUND && cont != cont->top_cgroup)
>  		return -EINVAL;
>  
>  	return 0;
--
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