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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20140801184815.22dd193f@notabene.brown>
Date:	Fri, 1 Aug 2014 18:48:15 +1000
From:	NeilBrown <neilb@...e.de>
To:	Dan Carpenter <dan.carpenter@...cle.com>
Cc:	Al Viro <viro@...IV.linux.org.uk>, Ian Kent <raven@...maw.net>,
	autofs@...r.kernel.org, lkml <linux-kernel@...r.kernel.org>,
	Randy Dunlap <rdunlap@...radead.org>,
	linux-fsdevel@...r.kernel.org,
	Christoph Hellwig <hch@...radead.org>
Subject: Re: [PATCH] VFS: allow ->d_manage() to declare -EISDIR in rcu_walk
 mode.

On Fri, 1 Aug 2014 11:33:18 +0300 Dan Carpenter <dan.carpenter@...cle.com>
wrote:

> On Wed, Jul 30, 2014 at 04:08:33PM +1000, NeilBrown wrote:
> > @@ -1110,11 +1110,16 @@ static bool __follow_mount_rcu(struct nameidata *nd, struct path *path,
> >  		 * Don't forget we might have a non-mountpoint managed dentry
> >  		 * that wants to block transit.
> >  		 */
> > -		if (unlikely(managed_dentry_might_block(path->dentry)))
> > +		switch (managed_dentry_rcu(path->dentry)) {
> > +		case -ECHILD:
> > +		default:
> >  			return false;
> > +		case -EISDIR:
> > +			return true;
> > +		}
> >  
> 
> Smatch says that any lines after that switch statement are unreachable.
> 
> Is the "default" intended?

Ugh.  It was an after thought.

The defined error codes are -ECHILD and -EISDIR.
But current code actually treats any other negative number as -ECHILD.
So I stuck in the default .... which of course was wrong.
I need to add
   case 0:
       break;

I'll send that out on Monday.

Thanks heaps.

NeilBrown


> 
> >  		if (!d_mountpoint(path->dentry))
> > -			return true;
> > +			return !(path->dentry->d_flags & DCACHE_NEED_AUTOMOUNT);
> >  
> >  		mounted = __lookup_mnt(path->mnt, path->dentry);
> >  		if (!mounted)
> 
> regards,
> dan carpenter


Download attachment "signature.asc" of type "application/pgp-signature" (829 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ