From: Miklos Szeredi Date: Tue, 10 May 2011 15:35:58 +0000 (+0200) Subject: fuse: fix oops in revalidate when called with NULL nameidata X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=d24339059d640f108c08ba99ef30e3bafa10f8e4;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git fuse: fix oops in revalidate when called with NULL nameidata 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 Signed-off-by: Miklos Szeredi --- diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c index c6ba49bd95b3..b32eb29a4e6f 100644 --- a/fs/fuse/dir.c +++ b/fs/fuse/dir.c @@ -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);