]> 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)
committerSteve French <sfrench@us.ibm.com>
Mon, 25 Jul 2011 22:06:40 +0000 (22:06 +0000)
commitd0c3e604c34ce0f1e221cfdef5da91bac7ef5fdb
tree8c65823f6076c2bf25e11f5756abe704deca7708
parentbbf4ac826bdc73ce2c6adf8cfd953e88842020f0
CIFS: Fix oops while mounting with prefixpath

commit 53124aa0fba0528fcc1c87a41ac5cfced01845fa 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>
fs/cifs/dir.c