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: <20110920154857.GE2380@linux.vnet.ibm.com>
Date:	Tue, 20 Sep 2011 08:48:57 -0700
From:	"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>
To:	Oleg Nesterov <oleg@...hat.com>
Cc:	"Serge E. Hallyn" <serge@...lyn.com>,
	Andrew Morton <akpm@...ux-foundation.org>,
	David Howells <dhowells@...hat.com>,
	"Serge E. Hallyn" <serge.hallyn@...onical.com>,
	lkml <linux-kernel@...r.kernel.org>, richard@....at,
	"Eric W. Biederman" <ebiederm@...ssion.com>,
	Tejun Heo <tj@...nel.org>
Subject: Re: [PATCH 1/2] creds: kill __task_cred()->task_is_dead() check

On Tue, Sep 20, 2011 at 05:40:15PM +0200, Oleg Nesterov wrote:
> On 09/20, Paul E. McKenney wrote:
> >
> > On Tue, Sep 20, 2011 at 04:39:42PM +0200, Oleg Nesterov wrote:
> > >
> > > --- 3.1/include/linux/cred.h~1_kill_task_is_dead	2011-09-20 16:28:22.000000000 +0200
> > > +++ 3.1/include/linux/cred.h	2011-09-20 16:28:47.000000000 +0200
> > > @@ -284,8 +284,7 @@ static inline void put_cred(const struct
> > >  #define __task_cred(task)						\
> > >  	({								\
> > >  		const struct task_struct *__t = (task);			\
> > > -		rcu_dereference_check(__t->real_cred,			\
> > > -				      task_is_dead(__t));		\
> > > +		rcu_dereference_check(__t->real_cred, 0);		\
> >
> > The "0" above will make lockdep-RCU complain unconditionally.  My guess
> > is that you want rcu_dereference_raw().
> 
> Hmm. I hope you are wrong this time ;)
> 
> rcu_dereference_check() checks rcu_read_lock_held(). IOW, with this
> change __task_cred() always requires rcu_read_lock(), and this is
> what the patch wants.

Oy...  rcu_dereference_check(), not rcu_dereference_protected().

You are correct.

But why not just rcu_dereference()?

> The next one adds " || (task == current" to the rcu_read_lock_held()
> check above.

OK, I guess I got my answer.  ;-)

							Thanx, Paul
--
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