]> git.baikalelectronics.ru Git - kernel.git/commit
CIFS: Fix oops while mounting with prefixpath
authorPavel Shilovsky <piastryyy@gmail.com>
Mon, 25 Jul 2011 13:59:10 +0000 (17:59 +0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Mon, 25 Jul 2011 18:23:21 +0000 (14:23 -0400)
commit4fc607dd66cc84240a8994e4b14b512610d16c66
tree2d0af7b870f0c56a4b81938a65276565e8b0ac2b
parent6b2f81a11ba330648f1c253e761b2ed774ed3578
CIFS: Fix oops while mounting with prefixpath

commit 00cde8d1382466c1e3f1427039908fdf71afa769 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>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/cifs/dir.c