diff options
author | Jeff Layton <jlayton@redhat.com> | 2011-08-05 09:02:40 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-08-15 21:31:36 -0400 |
commit | cae28d950cc7319a7e88deccbb0c4492f0830e6e (patch) | |
tree | 603d7c619e4d7c61b8cffbc7df5bc34f812f4f5d /fs/cifs | |
parent | 6fd70fafa11fd88d5beee360395f4c0b28d7af43 (diff) |
cifs: cope with negative dentries in cifs_get_root
commit 80975d21aae2136ccae1ce914a1602dc1d8b0795 upstream.
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>
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: Steve French <sfrench@us.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'fs/cifs')
-rw-r--r-- | fs/cifs/cifsfs.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/cifs/cifsfs.c b/fs/cifs/cifsfs.c index bc4b12ca537..fc7e57b3f38 100644 --- a/fs/cifs/cifsfs.c +++ b/fs/cifs/cifsfs.c | |||
@@ -581,6 +581,10 @@ cifs_get_root(struct smb_vol *vol, struct super_block *sb) | |||
581 | mutex_unlock(&dir->i_mutex); | 581 | mutex_unlock(&dir->i_mutex); |
582 | dput(dentry); | 582 | dput(dentry); |
583 | dentry = child; | 583 | dentry = child; |
584 | if (!dentry->d_inode) { | ||
585 | dput(dentry); | ||
586 | dentry = ERR_PTR(-ENOENT); | ||
587 | } | ||
584 | } while (!IS_ERR(dentry)); | 588 | } while (!IS_ERR(dentry)); |
585 | _FreeXid(xid); | 589 | _FreeXid(xid); |
586 | kfree(full_path); | 590 | kfree(full_path); |