diff options
author | Steve French <smfrench@gmail.com> | 2014-10-16 16:13:14 -0400 |
---|---|---|
committer | Steve French <smfrench@gmail.com> | 2014-10-16 16:20:20 -0400 |
commit | 9ffc5412964d5b276227684124efb702ec387c19 (patch) | |
tree | ef8faf651808d4d3ba4555ed8e04819c792bfa1a /fs | |
parent | b5b374eab11ef60d789e28bc36c18e2d08703212 (diff) |
Check minimum response length on query_network_interface
Acked-by: Shirish Pargaonkar <shirishpargaonkar@gmail.com>
Signed-off-by: Steve French <smfrench@gmail.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/cifs/smb2ops.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/fs/cifs/smb2ops.c b/fs/cifs/smb2ops.c index af446866cbe8..c5f521bcdee2 100644 --- a/fs/cifs/smb2ops.c +++ b/fs/cifs/smb2ops.c | |||
@@ -265,15 +265,18 @@ SMB3_request_interfaces(const unsigned int xid, struct cifs_tcon *tcon) | |||
265 | FSCTL_QUERY_NETWORK_INTERFACE_INFO, true /* is_fsctl */, | 265 | FSCTL_QUERY_NETWORK_INTERFACE_INFO, true /* is_fsctl */, |
266 | NULL /* no data input */, 0 /* no data input */, | 266 | NULL /* no data input */, 0 /* no data input */, |
267 | (char **)&out_buf, &ret_data_len); | 267 | (char **)&out_buf, &ret_data_len); |
268 | 268 | if (rc != 0) | |
269 | if ((rc == 0) && (ret_data_len > 0)) { | 269 | cifs_dbg(VFS, "error %d on ioctl to get interface list\n", rc); |
270 | else if (ret_data_len < sizeof(struct network_interface_info_ioctl_rsp)) { | ||
271 | cifs_dbg(VFS, "server returned bad net interface info buf\n"); | ||
272 | rc = -EINVAL; | ||
273 | } else { | ||
270 | /* Dump info on first interface */ | 274 | /* Dump info on first interface */ |
271 | cifs_dbg(FYI, "Adapter Capability 0x%x\t", | 275 | cifs_dbg(FYI, "Adapter Capability 0x%x\t", |
272 | le32_to_cpu(out_buf->Capability)); | 276 | le32_to_cpu(out_buf->Capability)); |
273 | cifs_dbg(FYI, "Link Speed %lld\n", | 277 | cifs_dbg(FYI, "Link Speed %lld\n", |
274 | le64_to_cpu(out_buf->LinkSpeed)); | 278 | le64_to_cpu(out_buf->LinkSpeed)); |
275 | } else | 279 | } |
276 | cifs_dbg(VFS, "error %d on ioctl to get interface list\n", rc); | ||
277 | 280 | ||
278 | return rc; | 281 | return rc; |
279 | } | 282 | } |