Skip to contentSkip to conversation

cifs: fix CIFS_IOC_GET_MNT_INFO oops

PATCH Applied David Disseldorp 2 participants 2 messages May 3, 2017 – May 4, 2017 1 message not in the archive

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cifs: fix CIFS_IOC_GET_MNT_INFO oops

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

Fixes 0de1f4c6f6c0 ("Add way to query server fs info for smb3")
---
 fs/cifs/ioctl.c | 2 ++
 1 file changed, 2 insertions(+)
fs/cifs/ioctl.c +2 -0
index 4d598a71cf84..76fb0917dc8c 100644
@@ -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;
Signature · 1 line
2.12.0
Applied
#2 lore raw
In reply to a message not in the archive

merged into cifs-2.6.git thx

Quoted 29 lines · David Disseldorp

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

Fixes 0de1f4c6f6c0 ("Add way to query server fs info for smb3")
---
 fs/cifs/ioctl.c | 2 ++
 1 file changed, 2 insertions(+)
fs/cifs/ioctl.c +2 -1
index 4d598a71cf84..76fb0917dc8c 100644
@@ -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;
--

2.12.0

--
To unsubscribe from this list: send the line "unsubscribe linux-cifs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html

Signature · 3 lines
Thanks,

Steve