Skip to content
This repository has been archived by the owner on Sep 24, 2020. It is now read-only.

Commit

Permalink
cifs: fix CIFS_ENUMERATE_SNAPSHOTS oops
Browse files Browse the repository at this point in the history
commit 6026685 upstream.

As with 6187639, an open directory may have a NULL private_data
pointer prior to readdir. CIFS_ENUMERATE_SNAPSHOTS must check for this
before dereference.

Fixes: 834170c ("Enable previous version support")
Signed-off-by: David Disseldorp <[email protected]>
Signed-off-by: Steve French <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
ddiss authored and gregkh committed May 20, 2017
1 parent 63d86cd commit 076c404
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 @@ -213,6 +213,8 @@ long cifs_ioctl(struct file *filep, unsigned int command, unsigned long arg)
rc = smb_mnt_get_fsinfo(xid, tcon, (void __user *)arg);
break;
case CIFS_ENUMERATE_SNAPSHOTS:
if (pSMBFile == NULL)
break;
if (arg == 0) {
rc = -EINVAL;
goto cifs_ioc_exit;
Expand Down

0 comments on commit 076c404

Please sign in to comment.