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-next>] [day] [month] [year] [list]
Date:	Fri, 2 Sep 2011 14:37:06 +0200
From:	Oleg Nesterov <oleg@...hat.com>
To:	akpm@...ux-foundation.org
Cc:	linux-kernel@...r.kernel.org, bblum@...rew.cmu.edu,
	fweisbec@...il.com, neilb@...e.de, paul@...lmenage.org,
	paulmck@...ux.vnet.ibm.com
Subject: Re: +
	cgroups-more-safe-tasklist-locking-in-cgroup_attach_proc.patch
	added to -mm tree

> From: Ben Blum <bblum@...rew.cmu.edu>
>
> Fix unstable tasklist locking in cgroup_attach_proc.
>
> According to this thread - https://lkml.org/lkml/2011/7/27/243 - RCU is
> not sufficient to guarantee the tasklist is stable w.r.t.  de_thread and
> exit.  Taking tasklist_lock for reading, instead of rcu_read_lock, ensures
> proper exclusion.

I still think we should avoid the global lock.

In any case, with tasklist or siglock,

> -	rcu_read_lock();
> +	read_lock(&tasklist_lock);
>  	if (!thread_group_leader(leader)) {
>  		/*
>  		 * a race with de_thread from another thread's exec() may strip
> @@ -2036,7 +2036,7 @@ int cgroup_attach_proc(struct cgroup *cg
>  		 * throw this task away and try again (from cgroup_procs_write);
>  		 * this is "double-double-toil-and-trouble-check locking".
>  		 */
> -		rcu_read_unlock();
> +		read_unlock(&tasklist_lock);
>  		retval = -EAGAIN;

this check+comment becomes completely pointless and imho very confusing.

Oleg.

--
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