All of lore.kernel.org
 help / color / mirror / Atom feed
From: Al Viro <viro-3bDd1+5oDREiFSDQTTA3OLVCufUGDwFn@public.gmane.org>
To: Jiri Slaby <jslaby-AlSwsSmVLrQ@public.gmane.org>
Cc: sfrench-eUNUBHrolfbYtjvyW6yDsg@public.gmane.org,
	linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	jirislaby-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
	linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Jeff Layton <jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
	Christoph Hellwig <hch-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org>
Subject: Re: [PATCH v2 1/1] FS: cifs, remove unneeded NULL tests
Date: Wed, 3 Nov 2010 10:00:12 +0000	[thread overview]
Message-ID: <20101103100012.GA19804@ZenIV.linux.org.uk> (raw)
In-Reply-To: <1288624135-24170-1-git-send-email-jslaby-AlSwsSmVLrQ@public.gmane.org>

On Mon, Nov 01, 2010 at 04:08:55PM +0100, Jiri Slaby wrote:
> Stanse found that pSMBFile in cifs_ioctl and file->f_path.dentry in
> cifs_user_write are dereferenced prior their test to NULL.

file->f_path.dentry is never NULL for an opened file, neither is
file->f_path.dentry->d_inode (which cannot change for the entire
lifetime of dentry, BTW).  IOW,

> -	/* since the write may have blocked check these pointers again */
> -	if ((file->f_path.dentry) && (file->f_path.dentry->d_inode)) {
> -		struct inode *inode = file->f_path.dentry->d_inode;

in there had always been junk.  So yes, losing these tests is the right
thing to do.

WARNING: multiple messages have this Message-ID (diff)
From: Al Viro <viro@ZenIV.linux.org.uk>
To: Jiri Slaby <jslaby@suse.cz>
Cc: sfrench@samba.org, linux-fsdevel@vger.kernel.org,
	linux-kernel@vger.kernel.org, jirislaby@gmail.com,
	linux-cifs@vger.kernel.org, Jeff Layton <jlayton@redhat.com>,
	Christoph Hellwig <hch@infradead.org>
Subject: Re: [PATCH v2 1/1] FS: cifs, remove unneeded NULL tests
Date: Wed, 3 Nov 2010 10:00:12 +0000	[thread overview]
Message-ID: <20101103100012.GA19804@ZenIV.linux.org.uk> (raw)
In-Reply-To: <1288624135-24170-1-git-send-email-jslaby@suse.cz>

On Mon, Nov 01, 2010 at 04:08:55PM +0100, Jiri Slaby wrote:
> Stanse found that pSMBFile in cifs_ioctl and file->f_path.dentry in
> cifs_user_write are dereferenced prior their test to NULL.

file->f_path.dentry is never NULL for an opened file, neither is
file->f_path.dentry->d_inode (which cannot change for the entire
lifetime of dentry, BTW).  IOW,

> -	/* since the write may have blocked check these pointers again */
> -	if ((file->f_path.dentry) && (file->f_path.dentry->d_inode)) {
> -		struct inode *inode = file->f_path.dentry->d_inode;

in there had always been junk.  So yes, losing these tests is the right
thing to do.

  parent reply	other threads:[~2010-11-03 10:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-01 15:08 [PATCH v2 1/1] FS: cifs, remove unneeded NULL tests Jiri Slaby
     [not found] ` <1288624135-24170-1-git-send-email-jslaby-AlSwsSmVLrQ@public.gmane.org>
2010-11-01 16:23   ` Jeff Layton
2010-11-01 16:23     ` Jeff Layton
2010-11-03 10:00   ` Al Viro [this message]
2010-11-03 10:00     ` Al Viro

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=20101103100012.GA19804@ZenIV.linux.org.uk \
    --to=viro-3bdd1+5odreifsdqtta3olvcufugdwfn@public.gmane.org \
    --cc=hch-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org \
    --cc=jirislaby-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=jlayton-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=jslaby-AlSwsSmVLrQ@public.gmane.org \
    --cc=linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-fsdevel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=sfrench-eUNUBHrolfbYtjvyW6yDsg@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.