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:	Thu, 10 Dec 2009 15:20:20 -0500
From:	Valerie Aurora <vaurora@...hat.com>
To:	Erez Zadok <ezk@...sunysb.edu>
Cc:	Jan Blunck <jblunck@...e.de>,
	Alexander Viro <viro@...iv.linux.org.uk>,
	Christoph Hellwig <hch@...radead.org>,
	Andy Whitcroft <apw@...onical.com>,
	Scott James Remnant <scott@...onical.com>,
	Sandu Popa Marius <sandupopamarius@...il.com>,
	Jan Rekorajski <baggins@...h.mimuw.edu.pl>,
	"J. R. Okajima" <hooanon05@...oo.co.jp>,
	Arnd Bergmann <arnd@...db.de>,
	Vladimir Dronnikov <dronnikov@...il.com>,
	Felix Fietkau <nbd@...nwrt.org>, linux-fsdevel@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH 01/41] VFS: BUG() if somebody tries to rehash an already hashed dentry

On Sun, Nov 29, 2009 at 08:43:58PM -0500, Erez Zadok wrote:
> In message <1256152779-10054-2-git-send-email-vaurora@...hat.com>, Valerie Aurora writes:
> > From: Jan Blunck <jblunck@...e.de>
> > 
> > Break early when somebody tries to rehash an already hashed dentry.
> > Otherwise this leads to interesting corruptions in the dcache hash table
> > later on.
> > 
> > Signed-off-by: Jan Blunck <jblunck@...e.de>
> > Signed-off-by: Valerie Aurora <vaurora@...hat.com>
> > ---
> >  fs/dcache.c |    1 +
> >  1 files changed, 1 insertions(+), 0 deletions(-)
> > 
> > diff --git a/fs/dcache.c b/fs/dcache.c
> > index 9e5cd3c..38bf982 100644
> > --- a/fs/dcache.c
> > +++ b/fs/dcache.c
> > @@ -1550,6 +1550,7 @@ void d_rehash(struct dentry * entry)
> >  {
> >  	spin_lock(&dcache_lock);
> >  	spin_lock(&entry->d_lock);
> > +	BUG_ON(!d_unhashed(entry));
> >  	_d_rehash(entry);
> >  	spin_unlock(&entry->d_lock);
> >  	spin_unlock(&dcache_lock);
> 
> This patch seems unrelated to union mounts.  If so, can you get it pushed
> upstream sooner?  Or is this a debugging patch useful only when developing
> union mounts?
>
> You also said that it can lead to "ineresting corruptions".  What kind of
> corruptions exactly?  Also, would it make more sense to allow _d_rehash() to
> hash in an unhashed dentry for the first time?

Hi Erez,

Thanks for your great review!  I am working my way through your
comments one by one.

This is a trivial patch which happened to be useful during our
development and seems like it might be useful for other VFS-related
development.  I will submit it as part of our VFS patch set and drop
it if the maintainers don't want it.

I don't have an opinion on _d_rehash(), I'm afraid.

-VAL
--
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