lkml.org 
[lkml]   [2008]   [Sep]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: 2.6.27-rc7-sha1: EIP at proc_sys_compare+0x36/0x50
Linus Torvalds <torvalds@linux-foundation.org> writes:

> I actually like my second patch better - it looks simpler, and it means
> that the rules for filesystems using d_compare() are a bit clearer: at
> least we'll only pass them dentries to look at that haven't gone through
> d_drop (and we do hold dentry->d_lock that serializes all of that).
>
> So here it is again (I sent it out just minutes ago, but you weren't on
> that cc, you must have picked this up off the kernel list)
>
> NOTE! Totally untested patch! It looks sane and really obvious, but maybe
> it has some insane and non-obvious bug.

We definitely have a race between d_kill setting dentry->d_inode = NULL
and proc_sys_compare reading d_inode.

We don't generate negative dentries for /proc/sys.

In dput atomic_dec_and_lock takes the lock before setting the count to 0.
So there is no race there.

Testing for d_unhashed and getting us out of rcu limbo before calling
into the filesystem methods makes the reasoning a lot clearer.


Looks good to me.

Reviewed-by: "Eric W. Biederman" <ebiederm@xmission.com>



\
 
 \ /
  Last update: 2008-09-29 05:07    [from the cache]
©2003-2011 Jasper Spaans