All of lore.kernel.org
 help / color / mirror / Atom feed
From: Al Viro <viro-3bDd1+5oDREiFSDQTTA3OLVCufUGDwFn@public.gmane.org>
To: Pavel Shilovsky <piastryyy-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: Jeff Layton <jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
	smfrench-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
	linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH] cifs: cope with negative dentries in cifs_get_root
Date: Tue, 9 Aug 2011 07:38:00 +0100	[thread overview]
Message-ID: <20110809063800.GE2203@ZenIV.linux.org.uk> (raw)
In-Reply-To: <CAKywueRT9cGPu5pCiiYONd7DruBaE2TDvHVVyyELYwM_Ft5e+Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

On Tue, Aug 09, 2011 at 09:41:33AM +0400, Pavel Shilovsky wrote:
> > ? ? ? ? ? ? ? ?mutex_unlock(&dir->i_mutex);
> > ? ? ? ? ? ? ? ?dput(dentry);
> > ? ? ? ? ? ? ? ?dentry = child;
> > + ? ? ? ? ? ? ? if (!dentry->d_inode) {
> 
> dentry can be NULL here (returned from lookup_one_len) and it can
> cause a null pointer dereference.

Not NULL, ERR_PTR(...).  IOW, we need to check IS_ERR(dentry) to protect
that check of dentry->d_inode.

      parent reply	other threads:[~2011-08-09  6:38 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-05 13:02 [PATCH] cifs: cope with negative dentries in cifs_get_root Jeff Layton
2011-08-05 15:03 ` Steve French
     [not found] ` <1312549360-4317-1-git-send-email-jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2011-08-05 14:54   ` Al Viro
     [not found]     ` <20110805145428.GS2203-3bDd1+5oDREiFSDQTTA3OLVCufUGDwFn@public.gmane.org>
2011-08-05 15:01       ` Steve French
     [not found]         ` <CAH2r5mvB8jyZnnSaGCs1Z=NWMCh6LQBpwTR3hY1Fv9pxw54+Kw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-08-05 15:15           ` Al Viro
2011-08-09  5:41   ` Pavel Shilovsky
     [not found]     ` <CAKywueRT9cGPu5pCiiYONd7DruBaE2TDvHVVyyELYwM_Ft5e+Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-08-09  6:38       ` Al Viro [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=20110809063800.GE2203@ZenIV.linux.org.uk \
    --to=viro-3bdd1+5odreifsdqtta3olvcufugdwfn@public.gmane.org \
    --cc=jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=piastryyy-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=smfrench-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.