From: Ian Kent <raven@themaw.net>
To: David Ahern <dsahern@gmail.com>
Cc: autofs@vger.kernel.org, viro@ZenIV.linux.org.uk,
linux-kernel@vger.kernel.org
Subject: Re: NULL pointer dereference in autofs4_expire_wait
Date: Sat, 12 Oct 2013 09:56:24 +0800 [thread overview]
Message-ID: <1381542984.2272.21.camel@perseus.fritz.box> (raw)
In-Reply-To: <5257FD34.2060406@gmail.com>
On Fri, 2013-10-11 at 07:29 -0600, David Ahern wrote:
> On 10/11/13 3:55 AM, Ian Kent wrote:
> > On Fri, 2013-10-11 at 10:06 +0800, Ian Kent wrote:
> >> On Thu, 2013-10-10 at 17:22 -0600, David Ahern wrote:
> >>> Running 3.12-rc3 just hit BUG in autofs4_expire_wait
> >>
> >> It doesn't look like this could be due to Al's change to the locking in
> >> autos4_wait() and that the only change to autofs that I'm aware of.
> >>
> >> Could you do a bisect please?
> >
> > Of course that assumes it's repeatable.
> > Is it?
> >
> > Can you provide any information about the environment and activity that
> > was happening at the time of the BUG()?
>
> The system was up and running for 9 days before hitting the BUG. After
> that with 3 cpus on softlockup I had to do a reboot (forced). After the
> reboot I continued the workload again without a repeat incident (yet),
> so I am not sure bisect is going to be possible.
Yeah, it isn't repeatable.
>
> This is a corporate environment where practically everything is in an
> automount. Specific to this problem I was repeatedly building a
> workspace in one window, using cscope in another and checking code
> against a different workspace in a third -- all 3 of those were
> different automounts and different NAS servers.
>
> From objdump on vmlinux the line in question is fs/autofs4/expire.c:465
>
> if (ino->flags & AUTOFS_INF_EXPIRING) {
Right, there haven't been changes to the autofs kernel code that affect
the reference counting of dentrys so I have to conclude this is being
caused by other changes.
When walking an autofs path, the walk should always be put into refwalk
mode, so the function containing this line should always have a dentry
with a reference held. Which just means that the autofs info struct (ino
here) won't be invalid.
Now ->d_release() (which frees ino) is only called after the dentry
reference count falls to zero and the dentry is going away.
We can't check ino for NULL here because the dentry pointer to it isn't
set to NULL when it's freed in ->d_release(). Setting the dentry field
to NULL is futile because the next thing the VFS does is to free the
dentry itself. Well, it calls RCU to schedule the free anyway.
The fact that ->d_release() has been called makes me think there's a
reference counting problem somewhere in the VFS.
Al, is my thinking correct here?
There were some significant changes to this area of the VFS in 3.11 by
the look of it.
So more history please, had you used 3.11 for an extended amount of
time, before using the 3.12-rc? IOW what's your kernel version use
history please?
Ian
next prev parent reply other threads:[~2013-10-12 1:56 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <525736C7.9080400@gmail.com>
2013-10-11 2:06 ` NULL pointer dereference in autofs4_expire_wait Ian Kent
2013-10-11 9:55 ` Ian Kent
2013-10-11 13:29 ` David Ahern
2013-10-12 1:56 ` Ian Kent [this message]
2013-10-13 20:13 ` David Ahern
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=1381542984.2272.21.camel@perseus.fritz.box \
--to=raven@themaw.net \
--cc=autofs@vger.kernel.org \
--cc=dsahern@gmail.com \
--cc=linux-kernel@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).