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:	Mon, 29 Mar 2010 12:21:59 -0700
From:	"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>
To:	David Howells <dhowells@...hat.com>
Cc:	Trond.Myklebust@...app.com, linux-nfs@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] NFS: Fix RCU warnings in
 nfs_inode_return_delegation_noreclaim() [ver #2]

On Mon, Mar 29, 2010 at 08:02:28PM +0100, David Howells wrote:
> Paul E. McKenney <paulmck@...ux.vnet.ibm.com> wrote:
> 
> > >  	spin_lock(&clp->cl_lock);
> > > -	if (rcu_dereference(nfsi->delegation) != NULL) {
> > > +	if (nfsi->delegation != NULL) {
> > 
> > And this one.  I thought that Trond said that clp->cl_lock protects
> > this one, in which case this should work:
> > 
> > 	if (rcu_dereference_check(nfsi->delegation,
> > 				  lockdep_is_held(&clp->cl_lock)) != NULL) {
> 
> If clp->cl_lock protects this pointer, why the need for rcu_dereference_check()
> at all?  The check is redundant since the line above gets the very lock we're
> checking for.

Because Arnd Bergmann is working on a set of patches that makes sparse
complain if you access an RCU-protected pointer directly, without using
some flavor of rcu_dereference().

So your approach would work for the moment, but would need another
change, probably in the 2.6.35 timeframe.

> > > -	if (rcu_dereference(nfsi->delegation) != NULL) {
> > > +	if (nfsi->delegation != NULL) {
> > 
> > And this one, although the check for cp->cl_lock obviously won't work here.
> > 
> > >  		spin_lock(&clp->cl_lock);
> > >  		delegation = nfs_detach_delegation_locked(nfsi, NULL);
> > >  		spin_unlock(&clp->cl_lock);
> 
> On this one, why does nfsi->delegation need a memory barrier interpolating
> afterwards?  It has an implicit one in the form of the spin_lock() immediately
> after, if the value of the pointer wasn't NULL.  What two memory accesses is
> the memory barrier ordering?
> 
> Ditto on the next one.

I must defer to Trond on this one.

							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