mirror of
https://gitee.com/bianbu-linux/linux-6.6
synced 2025-04-24 14:07:52 -04:00
CIFS: Fix oops while mounting with prefixpath
commit fec11dd9a0
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>
This commit is contained in:
parent
340a0a01b9
commit
3ca30d40a9
1 changed files with 1 additions and 1 deletions
|
@ -641,7 +641,7 @@ lookup_out:
|
|||
static int
|
||||
cifs_d_revalidate(struct dentry *direntry, struct nameidata *nd)
|
||||
{
|
||||
if (nd->flags & LOOKUP_RCU)
|
||||
if (nd && (nd->flags & LOOKUP_RCU))
|
||||
return -ECHILD;
|
||||
|
||||
if (direntry->d_inode) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue