]> Git Repo - linux.git/commitdiff
CIFS: Fix oops while mounting with prefixpath
authorPavel Shilovsky <[email protected]>
Mon, 25 Jul 2011 13:59:10 +0000 (17:59 +0400)
committerSteve French <[email protected]>
Mon, 25 Jul 2011 22:06:40 +0000 (22:06 +0000)
commit fec11dd9a0109fe52fd631e5c510778d6cbff6cc caused
a regression when we have already mounted //server/share/a
and want to mount //server/share/a/b.

The problem is that lookup_one_len calls __lookup_hash
with nd pointer as NULL. Then __lookup_hash calls
do_revalidate in the case when dentry exists and we end
up with NULL pointer deference in cifs_d_revalidate:

if (nd->flags & LOOKUP_RCU)
return -ECHILD;

Fix this by checking nd for NULL.

Signed-off-by: Pavel Shilovsky <[email protected]>
Reviewed-by: Shirish Pargaonkar <[email protected]>
CC: Stable <[email protected]>
Signed-off-by: Steve French <[email protected]>
fs/cifs/dir.c

index 8e9d37d44e9da10f457ccb78c7ab63335fdc6e64..c1bd0306d6c6ec553452b8e4b3352cfd014a49c2 100644 (file)
@@ -636,7 +636,7 @@ lookup_out:
 static int
 cifs_d_revalidate(struct dentry *direntry, struct nameidata *nd)
 {
-       if (nd->flags & LOOKUP_RCU)
+       if (nd && (nd->flags & LOOKUP_RCU))
                return -ECHILD;
 
        if (direntry->d_inode) {
This page took 0.060289 seconds and 4 git commands to generate.