aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/cifsfs.c
diff options
context:
space:
mode:
authorJeff Layton <jlayton@redhat.com>2011-08-05 09:02:40 -0400
committerSteve French <sfrench@us.ibm.com>2011-08-05 11:03:09 -0400
commit80975d21aae2136ccae1ce914a1602dc1d8b0795 (patch)
treee2c5d8b441d3ff206c9dc671ade8f3d7c453e2d2 /fs/cifs/cifsfs.c
parentf9e8c45002cacad536b338dfa9e910e341a49c31 (diff)
cifs: cope with negative dentries in cifs_get_root
The loop around lookup_one_len doesn't handle the case where it might return a negative dentry, which can cause an oops on the next pass through the loop. Check for that and break out of the loop with an error of -ENOENT if there is one. Fixes the panic reported here: https://bugzilla.redhat.com/show_bug.cgi?id=727927 Reported-by: TR Bentley <home@trarbentley.net> Reported-by: Iain Arnell <iarnell@gmail.com> Cc: Al Viro <viro@ZenIV.linux.org.uk> Cc: stable@kernel.org Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: Steve French <sfrench@us.ibm.com>
Diffstat (limited to 'fs/cifs/cifsfs.c')
-rw-r--r--fs/cifs/cifsfs.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c
index 212e5629cc1d..f93eb948d071 100644
--- a/fs/cifs/cifsfs.c
+++ b/fs/cifs/cifsfs.c
@@ -563,6 +563,10 @@ cifs_get_root(struct smb_vol *vol, struct super_block *sb)
563 mutex_unlock(&dir->i_mutex); 563 mutex_unlock(&dir->i_mutex);
564 dput(dentry); 564 dput(dentry);
565 dentry = child; 565 dentry = child;
566 if (!dentry->d_inode) {
567 dput(dentry);
568 dentry = ERR_PTR(-ENOENT);
569 }
566 } while (!IS_ERR(dentry)); 570 } while (!IS_ERR(dentry));
567 _FreeXid(xid); 571 _FreeXid(xid);
568 kfree(full_path); 572 kfree(full_path);