mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Oliver Neukum <oliver@neukum.org>
To: Adrian Bunk <bunk@stusta.de>
Cc: Greg Kroah-Hartman <gregkh@suse.de>,
	Maneesh Soni <maneesh@in.ibm.com>,
	linux-kernel@vger.kernel.org
Subject: Re: sysfs_drop_dentry(): possible NULL dereference
Date: Mon, 19 Mar 2007 11:09:56 +0100	[thread overview]
Message-ID: <200703191109.57683.oliver@neukum.org> (raw)
In-Reply-To: <20070319092211.GG752@stusta.de>

Am Montag, 19. März 2007 10:22 schrieb Adrian Bunk:

>  void sysfs_drop_dentry(struct sysfs_dirent * sd, struct dentry * parent)
>  {
>         struct dentry * dentry = sd->s_dentry;
> +       struct inode *inode;
>  
>         if (dentry) {
>                 spin_lock(&dcache_lock);
>                 spin_lock(&dentry->d_lock);
>                 if (!(d_unhashed(dentry) && dentry->d_inode)) {
> +                       inode = dentry->d_inode;
> +                       spin_lock(&inode->i_lock);
> ...
> 
> <--  snip  -->
> 
> If (!dentry->d_inode), then it's a NULL dereference.

As far as I can tell, sysfs being a virtual filesystem, does not use
dentries without inodes associated.

	Regards
		Oliver

      reply	other threads:[~2007-03-19 10:10 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-19  9:22 Adrian Bunk
2007-03-19 10:09 ` Oliver Neukum [this message]

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=200703191109.57683.oliver@neukum.org \
    --to=oliver@neukum.org \
    --cc=bunk@stusta.de \
    --cc=gregkh@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maneesh@in.ibm.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

Powered by JetHome