public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jiri Slaby <jslaby@suse.cz>
To: jlbec@evilplan.org
Cc: npiggin@kernel.dk, Al Viro <viro@zeniv.linux.org.uk>,
	linux-fsdevel@vger.kernel.org,
	LKML <linux-kernel@vger.kernel.org>,
	Jiri Slaby <jirislaby@gmail.com>
Subject: Re: OOPS in configfs when doing d_delete
Date: Mon, 21 Feb 2011 11:47:09 +0100	[thread overview]
Message-ID: <4D6242AD.2090600@suse.cz> (raw)
In-Reply-To: <20110221104359.GA18538@noexit>

On 02/21/2011 11:44 AM, Joel Becker wrote:
> On Mon, Feb 21, 2011 at 11:20:18AM +0100, Jiri Slaby wrote:
>> when configfs_attach_group fails in configfs_register_subsystem:
>>         dentry = d_alloc(configfs_sb->s_root, &name);
>>         if (dentry) {
>>                 d_add(dentry, NULL);
>>
>>                 err = configfs_attach_group(sd->s_element, &group->cg_item,
>>                                             dentry);
>>                 if (err) {
>>                         d_delete(dentry);
>>                         dput(dentry);
>>
>>
>> d_delete kills the kernel. I don't know what the actual bug is here, but
>> d_delete looks broken anyway:
>>         spin_lock(&dentry->d_lock);
>>         inode = dentry->d_inode;
>>         isdir = S_ISDIR(inode->i_mode);  <======== dereference
>>         if (dentry->d_count == 1) {
>>                 if (inode && !spin_trylock(&inode->i_lock)) {
>>                     ^^^^^  <============= test
>>
>> It seems like a superfluous test, not a potential null dereference to
>> me, right?
> 
> 	I think you're right about the superfluous test, but I need more
> investigation to see what's going on.  Thanks for the report.
> 	What was causing attach_group() to fail?  Do you know?

Dunno, I just modprobe'd the configfs example from Doc dir
(configfs_example_macros).

regards,
-- 
js
suse labs

  reply	other threads:[~2011-02-21 10:55 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-21 10:20 OOPS in configfs when doing d_delete Jiri Slaby
2011-02-21 10:44 ` Joel Becker
2011-02-21 10:47   ` Jiri Slaby [this message]
2011-02-22  9:14     ` Joel Becker
2011-03-01 22:42       ` Jiri Slaby
2011-05-12  9:34       ` Jiri Slaby
2011-05-18 19:58         ` Joel Becker
2011-05-27 21:12           ` Jiri Slaby
2011-05-27 21:13             ` Joel Becker

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=4D6242AD.2090600@suse.cz \
    --to=jslaby@suse.cz \
    --cc=jirislaby@gmail.com \
    --cc=jlbec@evilplan.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=npiggin@kernel.dk \
    --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