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:	Tue, 5 Nov 2013 05:34:48 -0500
From:	Jeff Layton <jlayton@...hat.com>
To:	NeilBrown <neilb@...e.de>
Cc:	viro@...IV.linux.org.uk, linux-fsdevel@...r.kernel.org,
	linux-nfs@...r.kernel.org, linux-kernel@...r.kernel.org,
	chutzpah@...too.org, liguangc@...ibm.com
Subject: Re: [PATCH] [RFC] vfs: don't revalidate dentries that serve as
 mountpoints

On Tue, 5 Nov 2013 13:39:59 +1100
NeilBrown <neilb@...e.de> wrote:

> On Mon,  4 Nov 2013 20:16:26 -0500 Jeff Layton <jlayton@...hat.com> wrote:
> 
> > We had a couple of reports of people that are mounting NFS filesystems,
> > and then bind mounting certain local files onto dentries in that nfs
> > mount (sort of like a poor-man's unionmount).
> > 
> > This all works well until the dentry serving as the mountpoint fails
> > d_revalidate. The dentry will end up being invalidated which makes the
> > bind mount unreachable via pathwalk.
> > 
> > It doesn't make much sense to me to allow dentries to serve as
> > mountpoints to end up invalidated, so there's no real point in
> > attempting to d_revalidate them at all.
> > 
> > Reported-by: Patrick McLean <chutzpah@...too.org>
> > Reported-by: Guang Cheng Li <liguangc@...ibm.com>
> > Signed-off-by: Jeff Layton <jlayton@...hat.com>
> > ---
> >  fs/namei.c | 3 +++
> >  1 file changed, 3 insertions(+)
> > 
> > diff --git a/fs/namei.c b/fs/namei.c
> > index caa2805..5b10ad0 100644
> > --- a/fs/namei.c
> > +++ b/fs/namei.c
> > @@ -585,6 +585,9 @@ drop_root_mnt:
> >  
> >  static inline int d_revalidate(struct dentry *dentry, unsigned int flags)
> >  {
> > +	/* dentries that serve as mountpoints are always considered valid */
> > +	if (d_mountpoint(dentry))
> > +		return 1;
> >  	return dentry->d_op->d_revalidate(dentry, flags);
> >  }
> >  
> 
> Makes sense to me. But what about the parent or grandparent of the mountpoint?
> 
> Presumably we don't want to invalidate them either, and I don't think
> d_mountpoint() returns true for those, does it?
> 
> NeilBrown

Good point...

I think we're probably saved there (at least on NFS) by the
check_submounts_and_drop() call in nfs_lookup_revalidate.

Hmmm, that said...I did do most of this testing on a slightly older
kernel that doesn't have that call, and I can't reproduce this problem
on a 3.12-ish kernel. I think this is probably already fixed by Miklos'
patches that added that.

Sorry for the noise!
-- 
Jeff Layton <jlayton@...hat.com>

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ