linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Al Viro <viro@ZenIV.linux.org.uk>
To: Christoph Hellwig <hch@infradead.org>
Cc: linux-fsdevel@vger.kernel.org, xfs@oss.sgi.com
Subject: Re: inode_permission NULL pointer dereference in 3.13-rc1
Date: Sun, 24 Nov 2013 15:27:58 +0000	[thread overview]
Message-ID: <20131124152758.GL10323@ZenIV.linux.org.uk> (raw)
In-Reply-To: <20131124140413.GA19271@infradead.org>

On Sun, Nov 24, 2013 at 06:04:13AM -0800, Christoph Hellwig wrote:
> Seems I can reproduce this by doing a full xfstests run and then
> shutting down the VM.  Doesn't seem to happen with the XFS tree
> which is still based on 3.12-rc1.

may_lookup() with LOOKUP_RCU in nd->flags and NULL nd->inode, by
the look of it...  Interesting.

AFAICS, path_init() initializes nd->inode on all success exits.
As for the places where we reassign nd->inode, we have the following:
fs/namei.c:681: nd->inode = nd->path.dentry->d_inode;
	nd_jump_link(), we would've already left RCU mode
fs/namei.c:856:         nd->inode = nd->path.dentry->d_inode;
	follow_link() - ditto.
fs/namei.c:1160:        nd->inode = nd->path.dentry->d_inode;
	follow_dotdot_rcu()
fs/namei.c:1257:        nd->inode = nd->path.dentry->d_inode;
	follow_dotdot() - not in RCU mode
fs/namei.c:1547:        nd->inode = inode;
	walk_component() - inode can't be NULL here, variable has
been explicitly compared with NULL a few lines prior
fs/namei.c:1825:                nd->inode = inode;
	path_init() with LOOKUP_ROOT; not from stat(2) and it would've
already oopsed with NULL inode anyway.
fs/namei.c:1892:        nd->inode = nd->path.dentry->d_inode;
	path_init()
fs/namei.c:3006:        nd->inode = inode;
	do_last(), not from stat(2) and no may_lookup() done past that
point anyway.
fs/namei.c:3077:        nd->inode = dir->d_inode;
	do_last(), not from stat(2)

which seems to leave two candidates - follow_dotdot_rcu() and path_init(),
both setting nd->inode to nd->path.dentry->d_inode...

Could you try to reproduce it with something like
	if (read_seqretry(&mount_lock, nd->m_seq))
		goto failed;
slapped before the success exit in follow_dotdot_rcu(), just to see if
we are hitting some races with umount here?

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

  reply	other threads:[~2013-11-24 15:27 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 [this message]
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
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=20131124152758.GL10323@ZenIV.linux.org.uk \
    --to=viro@zeniv.linux.org.uk \
    --cc=hch@infradead.org \
    --cc=linux-fsdevel@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).