aboutsummaryrefslogtreecommitdiffstats
path: root/module
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2013-01-22 09:05:49 -0800
committerBrian Behlendorf <[email protected]>2013-01-22 09:38:17 -0800
commit09a661e960df49f1256ba4c5ae15f6956d27df84 (patch)
tree8b03581b19d0fa08227b204cde42e8df47b7916e /module
parentee93035378ff1f0769bb4216dc35057a2f14f9b9 (diff)
Fix zpl_revalidate() NULL deref
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 #1226
Diffstat (limited to 'module')
-rw-r--r--module/zfs/zpl_inode.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/module/zfs/zpl_inode.c b/module/zfs/zpl_inode.c
index 0f6f3a41e..e40628878 100644
--- a/module/zfs/zpl_inode.c
+++ b/module/zfs/zpl_inode.c
@@ -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)
{