From: Al Viro <viro@ZenIV.linux.org.uk>
To: Dave Chinner <david@fromorbit.com>
Cc: Christoph Hellwig <hch@infradead.org>,
linux-fsdevel@vger.kernel.org,
Linus Torvalds <torvalds@linux-foundation.org>,
xfs@oss.sgi.com
Subject: Re: inode_permission NULL pointer dereference in 3.13-rc1
Date: Thu, 28 Nov 2013 23:44:41 +0000 [thread overview]
Message-ID: <20131128234441.GQ10323@ZenIV.linux.org.uk> (raw)
In-Reply-To: <20131128225102.GS10988@dastard>
On Fri, Nov 29, 2013 at 09:51:02AM +1100, Dave Chinner wrote:
> > Looks like adding if (!nd->inode) { a bunch of printks } in the end of
> > path_init() makes the sucker disappear (so far 2 times out of 2, and
> > with a test run taking a bit under two hours, well...) The plain
> > WARN_ON(!nd->inode) in that place triggers just fine.
>
> I usually find that when printk() makes race conditions go away,
> switching to tracepoints works better. It's still not as good as
> reliable as when the debug is not there, but it seems to perturb
> race conditions a lot less.
Actually, I've just got the output from this run, and it's really interesting.
We get path_init() setting NULL nd->inode for open() of "/dev/ptmx" (from
/sbin/startpar). And what we have at the time we get to link_path_walk() is
* LOOKUP_RCU | LOOKUP_FOLLOW | LOOKUP_PARENT | LOOKUP_JUMPED in
nd->flags (as expected)
* current->fs->root, current->fs->pwd and nd->path being the same
vfsmount/dentry pair.
* dentry in question has ->d_sb->s_id containing "sda1", as expected
for root fs.
* ->mnt_root of that vfsmount being equal to dentry
So far, so good, right?
* d_count(dentry) is -128
* dentry->d_inode is NULL
In other words, what we get is an extra dput() somewhere. The trouble is,
all likely places I'm seeing in the "RCU'd vfsmounts" seem to be OK...
In theory, we might be hitting a _missing_ dput(), with counter wrapping
around, but that doesn't seem likely...
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
next prev parent reply other threads:[~2013-11-28 23:44 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-24 14:04 inode_permission NULL pointer dereference in 3.13-rc1 Christoph Hellwig
2013-11-24 15:27 ` Al Viro
2013-11-25 16:06 ` Christoph Hellwig
2013-11-26 13:11 ` Al Viro
2013-11-26 14:12 ` Christoph Hellwig
2013-11-27 6:43 ` Al Viro
2013-11-27 10:09 ` Christoph Hellwig
2013-11-28 16:26 ` Al Viro
2013-11-28 21:23 ` Al Viro
2013-11-28 22:51 ` Dave Chinner
2013-11-28 23:44 ` Al Viro [this message]
2013-11-29 1:46 ` Dave Chinner
2013-11-29 2:07 ` Al Viro
2013-11-29 2:17 ` Linus Torvalds
2013-11-29 2:07 ` Linus Torvalds
2013-11-29 2:41 ` Al Viro
2013-11-29 3:59 ` Al Viro
2013-11-29 4:06 ` Al Viro
2013-11-29 4:14 ` Al Viro
2013-11-29 6:59 ` Al Viro
2013-11-29 19:44 ` Greg KH
2013-11-29 20:17 ` Linus Torvalds
2013-11-29 23:55 ` Al Viro
2013-11-30 0:18 ` Linus Torvalds
2013-11-30 15:09 ` [GIT PULL] " Theodore Ts'o
2013-11-30 15:13 ` Theodore Ts'o
2013-11-27 21:51 ` Dave Chinner
2013-11-28 15:21 ` Theodore Ts'o
2013-11-28 15:36 ` Theodore Ts'o
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=20131128234441.GQ10323@ZenIV.linux.org.uk \
--to=viro@zeniv.linux.org.uk \
--cc=david@fromorbit.com \
--cc=hch@infradead.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=torvalds@linux-foundation.org \
--cc=xfs@oss.sgi.com \
/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