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, 21 Apr 2008 10:43:11 -0700
From:	"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>
To:	Linus Torvalds <torvalds@...ux-foundation.org>
Cc:	Herbert Xu <herbert@...dor.apana.org.au>,
	"Rafael J. Wysocki" <rjw@...k.pl>,
	LKML <linux-kernel@...r.kernel.org>, Ingo Molnar <mingo@...e.hu>,
	Andrew Morton <akpm@...ux-foundation.org>,
	linux-ext4@...r.kernel.org
Subject: Re: 2.6.25-git2: BUG: unable to handle kernel paging request at ffffffffffffffff

On Mon, Apr 21, 2008 at 10:30:19AM -0700, Linus Torvalds wrote:
> 
> 
> On Mon, 21 Apr 2008, Paul E. McKenney wrote:
> > 
> > I did take a quick look for improperly freeing dentries -- unhashed
> > dentries are freed directly, so if there is a code path that somehow
> > unhashes dentries and then d_free()s them without a grace period, we
> > have a problem.
> 
> No, not even then.
> 
> We *always* unhash the dentries before freeing them, but we very 
> consciously use "hlist_del_rcu()" on them, not "hlist_del_init()".
> 
> That, in turn, will mean that the "pprev" pointer will still be set, so 
> the "hlist_unhashed()" thing will *not* trigger.
> 
> IOW, when we do that direct-free with:
> 
> 	if (hlist_unhashed(&dentry->d_hash))
> 		__d_free(dentry);
> 
> the "hlist_unhashed()" will literally guarantee that i has *never* been on 
> a hash-list at all!

Got it, hlist_del_rcu() sets ->pprev to LIST_POISON2, which is non-NULL,
so the dentry still gets to wait for a grace period.  Color me blind!!!

> (If you want to test whether it is currently unhashed or not, you actually 
> have to use "d_unhashed()" on the dentry under the dentry lock, which 
> tests the DCACHE_UNHASHED bit).

And as it looks like you guessed, I was misreading the hlist_unhashed()
above as d_unhashed().  :-/

							Thanx, Paul

> Of course, there could be some bug in there, but the thing is, none of 
> this has even changed in a long time, certainly not since 2.6.25. Which is 
> why I think the dcache code is all fine, and the bug comes from somewhere 
> else corrupting the data structures.
> 
> 		Linus
--
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