public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: ebiederm@xmission.com (Eric W. Biederman)
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Hugh Dickins <hugh@veritas.com>,
	Al Viro <viro@ZenIV.linux.org.uk>,
	Alexey Dobriyan <adobriyan@gmail.com>,
	akpm@linux-foundation.org, linux-kernel@vger.kernel.org
Subject: Re: 2.6.27-rc7-sha1: EIP at proc_sys_compare+0x36/0x50
Date: Sun, 28 Sep 2008 20:05:22 -0700	[thread overview]
Message-ID: <m1hc7zabyl.fsf@frodo.ebiederm.org> (raw)
In-Reply-To: <alpine.LFD.1.10.0809281350410.3265@nehalem.linux-foundation.org> (Linus Torvalds's message of "Sun, 28 Sep 2008 13:55:29 -0700 (PDT)")

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>


  parent reply	other threads:[~2008-09-29  3:05 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-26 15:20 2.6.27-rc7-sha1: EIP at proc_sys_compare+0x36/0x50 Alexey Dobriyan
2008-09-26 15:47 ` Linus Torvalds
2008-09-27  8:44   ` Eric W. Biederman
2008-09-28 20:38     ` Linus Torvalds
2008-09-28 14:18   ` Al Viro
2008-09-28 19:28     ` Hugh Dickins
2008-09-28 20:55       ` Linus Torvalds
2008-09-28 20:59         ` Linus Torvalds
2008-09-28 22:07           ` Hugh Dickins
2008-09-29  3:05         ` Eric W. Biederman [this message]
2008-09-28 20:46     ` Linus Torvalds
2008-09-28 20:50       ` Linus Torvalds

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m1hc7zabyl.fsf@frodo.ebiederm.org \
    --to=ebiederm@xmission.com \
    --cc=adobriyan@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=hugh@veritas.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    --cc=viro@ZenIV.linux.org.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox