Linux filesystem development
 help / color / mirror / Atom feed
From: Shaya Potter <spotter@cs.columbia.edu>
To: Trond Myklebust <trond.myklebust@fys.uio.no>
Cc: Chaitanya Patti <crpatti@cs.sunysb.edu>, linux-fsdevel@vger.kernel.org
Subject: Re: Is a NULL check missing in nfs_lookup?
Date: Fri, 05 Jan 2007 10:00:22 -0500	[thread overview]
Message-ID: <1168009222.29243.19.camel@localhost.localdomain> (raw)
In-Reply-To: <1167999770.6050.39.camel@lade.trondhjem.org>

On Fri, 2007-01-05 at 13:22 +0100, Trond Myklebust wrote:
> On Thu, 2007-01-04 at 19:00 -0500, Chaitanya Patti wrote:
> > 
> > Hello everyone,
> > 
> > In the function nfs_lookup in nfs/dir.c , the following line (line # 926):
> > 
> > error = nfs_reval_fsid(nd->mnt, dir, &fhandle, &fattr);
> > 
> > uses `nd' without having checked if it is NULL.
> > 
> > Is this correct?
> 
> It is quite intentional and correct. Calling ->lookup() without correct
> intent information is a bug.

I'd agree with you (And even told the person the problem up front)
except it's not oopsing on a lack of intent information, it's oopsing
because nd is null and therefore can not access nd->mnt.

i.e. Let say I couldn't reconstruct nd perfectly (due to not knowing
vfsmnt information), I could possible construct a fake nd with the
proper intent information (i.e. very likely no intent information to be
passed) and it would still oops.

So my question,

is changing nfs_reval_fsid() from

static inline int nfs_reval_fsid(struct vfsmount *mnt...)
	that calls __nfs_revalidate_inode(...., mnt->mnt_root->d_inode);

and is called as error = nfs_reval_fsid(nd->mnt...) by nfs_lookup()

to 

static inline int nfs_reval_fsid(struct dentry * dentry...)
	that calls __nfs_revalidate_inode(server, dentry->d_inode);

and is called as error = nfs_reval_fsid(dentry->d_sb->s_root...) by
nfs_lookup() 

incorrect?

now, it could be me missing the boat here, I wouldn't be surprised.

thanks.


  reply	other threads:[~2007-01-05 15:01 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-05  0:00 Is a NULL check missing in nfs_lookup? Chaitanya Patti
2007-01-05  0:47 ` Shaya Potter
2007-01-05  1:59   ` Josef Sipek
2007-01-07 14:13   ` Ian Kent
2007-01-05 12:22 ` Trond Myklebust
2007-01-05 15:00   ` Shaya Potter [this message]
2007-01-05 16:01     ` Trond Myklebust
2007-01-05 17:11       ` Shaya Potter
2007-01-05 17:22         ` Al Viro
2007-01-05 17:22         ` Matthew Wilcox
2007-01-06  7:36           ` Why not pass "vfsmount" to VFS functions? Tetsuo Handa
2007-01-05 19:10   ` Is a NULL check missing in nfs_lookup? Erez Zadok
2007-01-05 19:23     ` Matthew Wilcox
2007-01-05 19:41       ` Muli Ben-Yehuda
2007-01-05 20:13       ` Erez Zadok

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=1168009222.29243.19.camel@localhost.localdomain \
    --to=spotter@cs.columbia.edu \
    --cc=crpatti@cs.sunysb.edu \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=trond.myklebust@fys.uio.no \
    /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