diff options
author | Pavel Shilovsky <piastryyy@gmail.com> | 2011-07-25 09:59:10 -0400 |
---|---|---|
committer | Steve French <sfrench@us.ibm.com> | 2011-07-25 18:06:40 -0400 |
commit | f5bc1e755d23d022bf948904386337fc3e5e29a8 (patch) | |
tree | 8c65823f6076c2bf25e11f5756abe704deca7708 /fs/cifs | |
parent | e010a5ef95b8b6a12b74b548578f7dcf93564347 (diff) |
CIFS: Fix oops while mounting with prefixpath
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 <piastryyy@gmail.com>
Reviewed-by: Shirish Pargaonkar <shirishp@us.ibm.com>
CC: Stable <stable@kernel.org>
Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs')
-rw-r--r-- | fs/cifs/dir.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/cifs/dir.c b/fs/cifs/dir.c index 8e9d37d44e9d..c1bd0306d6c6 100644 --- a/fs/cifs/dir.c +++ b/fs/cifs/dir.c | |||
@@ -636,7 +636,7 @@ lookup_out: | |||
636 | static int | 636 | static int |
637 | cifs_d_revalidate(struct dentry *direntry, struct nameidata *nd) | 637 | cifs_d_revalidate(struct dentry *direntry, struct nameidata *nd) |
638 | { | 638 | { |
639 | if (nd->flags & LOOKUP_RCU) | 639 | if (nd && (nd->flags & LOOKUP_RCU)) |
640 | return -ECHILD; | 640 | return -ECHILD; |
641 | 641 | ||
642 | if (direntry->d_inode) { | 642 | if (direntry->d_inode) { |