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:	Fri, 20 Mar 2015 09:38:33 +1100
From:	NeilBrown <neilb@...e.de>
To:	Al Viro <viro@...IV.linux.org.uk>
Cc:	linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 10/13] VFS/namei: handle LOOKUP_RCU in
 page_follow_link_light.

On Mon, 16 Mar 2015 22:50:40 +0000 Al Viro <viro@...IV.linux.org.uk> wrote:

> On Mon, Mar 16, 2015 at 03:43:20PM +1100, NeilBrown wrote:
> > +	char *kaddr;
> > +	struct page *page;
> > +	struct address_space *mapping = dentry->d_inode->i_mapping;
> 
> Who said that dentry->d_inode hasn't gone NULL by that point?
> 
> > +	nd_terminate_link(kaddr, dentry->d_inode->i_size, PAGE_SIZE - 1);
> 
> ... or changed here.  Again, dentry->d_inode is stable only if you are
> holding a reference to dentry.  That's why we have those dances around
> nd->inode, for example.  Doing unlazy_walk() is enough to stabilize the
> damn thing, so currently ->follow_link() doesn't have to worry about it.
> With your changes, though...

Ahhh - that's what nd->inode is for.  I wondered.

Am I correct in thinking that dentry->d_inode can only become NULL - it cannot
then become some other inode?

In that case the various follow_link methods that are sufficiently atomic for
rcu-walk just need something like:

 struct inode *inode = dentry->d_inode;

 if (!inode)
     return -ECHILD;

If ->d_inode can become another inode, then I suspect we need to pass the
inode as well as the dentry to ->follow_link.


Thanks,
NeilBrown

Content of type "application/pgp-signature" skipped

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ