Skip to content

Commit

Permalink
cifs: fix CIFS_IOC_GET_MNT_INFO oops
Browse files Browse the repository at this point in the history
An open directory may have a NULL private_data pointer prior to readdir.

Fixes: 0de1f4c ("Add way to query server fs info for smb3")
Cc: stable@vger.kernel.org
Signed-off-by: David Disseldorp <ddiss@suse.de>
Signed-off-by: Steve French <smfrench@gmail.com>
  • Loading branch information
David Disseldorp authored and Steve French committed May 4, 2017
1 parent b704e70 commit d8a6e50
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions fs/cifs/ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,8 @@ long cifs_ioctl(struct file *filep, unsigned int command, unsigned long arg)
rc = -EOPNOTSUPP;
break;
case CIFS_IOC_GET_MNT_INFO:
if (pSMBFile == NULL)
break;
tcon = tlink_tcon(pSMBFile->tlink);
rc = smb_mnt_get_fsinfo(xid, tcon, (void __user *)arg);
break;
Expand Down

0 comments on commit d8a6e50

Please sign in to comment.