[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20110812210555.115388308@clark.kroah.org>
Date: Fri, 12 Aug 2011 14:04:19 -0700
From: Greg KH <gregkh@...e.de>
To: linux-kernel@...r.kernel.org, stable@...nel.org
Cc: stable-review@...nel.org, torvalds@...ux-foundation.org,
akpm@...ux-foundation.org, alan@...rguk.ukuu.org.uk,
Al Viro <viro@...IV.linux.org.uk>,
Jeff Layton <jlayton@...hat.com>,
Steve French <sfrench@...ibm.com>
Subject: [34/90] cifs: cope with negative dentries in cifs_get_root
3.0-stable review patch. If anyone has any objections, please let us know.
------------------
From: Jeff Layton <jlayton@...hat.com>
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@...rbentley.net>
Reported-by: Iain Arnell <iarnell@...il.com>
Cc: Al Viro <viro@...IV.linux.org.uk>
Signed-off-by: Jeff Layton <jlayton@...hat.com>
Signed-off-by: Steve French <sfrench@...ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@...e.de>
---
fs/cifs/cifsfs.c | 4 ++++
1 file changed, 4 insertions(+)
--- a/fs/cifs/cifsfs.c
+++ b/fs/cifs/cifsfs.c
@@ -581,6 +581,10 @@ cifs_get_root(struct smb_vol *vol, struc
mutex_unlock(&dir->i_mutex);
dput(dentry);
dentry = child;
+ if (!dentry->d_inode) {
+ dput(dentry);
+ dentry = ERR_PTR(-ENOENT);
+ }
} while (!IS_ERR(dentry));
_FreeXid(xid);
kfree(full_path);
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists