Skip to content

Commit

Permalink
Fix zpl_revalidate() NULL deref
Browse files Browse the repository at this point in the history
In zpl_revalidate() it's possible for the nameidata to be NULL
for kernels which still accept the parameter.  In particular,
lookup_one_len() calls d_revalidate() with a NULL nameidata.

Resolve the issue by checking for a NULL nameidata in which case
just set the flags to 0.

Signed-off-by: Brian Behlendorf <[email protected]>
Closes openzfs#1226
  • Loading branch information
behlendorf committed Jan 22, 2013
1 parent ee93035 commit 09a661e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion module/zfs/zpl_inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ static int
#ifdef HAVE_D_REVALIDATE_NAMEIDATA
zpl_revalidate(struct dentry *dentry, struct nameidata *nd)
{
unsigned int flags = nd->flags;
unsigned int flags = (nd ? nd->flags : 0);
#else
zpl_revalidate(struct dentry *dentry, unsigned int flags)
{
Expand Down

0 comments on commit 09a661e

Please sign in to comment.