fuse: fix oops in revalidate when called with NULL nameidata
authorMiklos Szeredi <mszeredi@suse.cz>
Tue, 10 May 2011 15:35:58 +0000 (17:35 +0200)
committerMiklos Szeredi <mszeredi@suse.cz>
Tue, 10 May 2011 15:35:58 +0000 (17:35 +0200)
Some cases (e.g. ecryptfs) can call ->dentry_revalidate with NULL
nameidata.

https://bugzilla.kernel.org/show_bug.cgi?id=34732

Tyler Hicks pointed out that this bug was introduced by commit
e7c0a16786 "fuse: make fuse_dentry_revalidate() RCU aware"

Reported-by: Witold Baryluk <baryluk@smp.if.uj.edu.pl>
Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
fs/fuse/dir.c

index c6ba49bd95b34136d04bae30b83342933c35ce7a..b32eb29a4e6ff4f8dd892b1af9ea74d712f148ee 100644 (file)
@@ -174,7 +174,7 @@ static int fuse_dentry_revalidate(struct dentry *entry, struct nameidata *nd)
                if (!inode)
                        return 0;
 
-               if (nd->flags & LOOKUP_RCU)
+               if (nd && (nd->flags & LOOKUP_RCU))
                        return -ECHILD;
 
                fc = get_fuse_conn(inode);