Commit 6f3b2eed authored by David Disseldorp's avatar David Disseldorp Committed by Greg Kroah-Hartman

cifs: fix CIFS_IOC_GET_MNT_INFO oops

commit d8a6e505 upstream.

An open directory may have a NULL private_data pointer prior to readdir.

Fixes: 0de1f4c6 ("Add way to query server fs info for smb3")
Signed-off-by: default avatarDavid Disseldorp <ddiss@suse.de>
Signed-off-by: default avatarSteve French <smfrench@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent f13d96bf
...@@ -264,6 +264,8 @@ long cifs_ioctl(struct file *filep, unsigned int command, unsigned long arg) ...@@ -264,6 +264,8 @@ long cifs_ioctl(struct file *filep, unsigned int command, unsigned long arg)
rc = -EOPNOTSUPP; rc = -EOPNOTSUPP;
break; break;
case CIFS_IOC_GET_MNT_INFO: case CIFS_IOC_GET_MNT_INFO:
if (pSMBFile == NULL)
break;
tcon = tlink_tcon(pSMBFile->tlink); tcon = tlink_tcon(pSMBFile->tlink);
rc = smb_mnt_get_fsinfo(xid, tcon, (void __user *)arg); rc = smb_mnt_get_fsinfo(xid, tcon, (void __user *)arg);
break; break;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment