aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Disseldorp <[email protected]>2017-10-20 14:49:38 +0200
committerSteve French <[email protected]>2017-10-25 13:04:25 -0500
commita2d9daad1d2dfbd307ab158044d1c323d7babbde (patch)
tree930b847cdec5700e372ad6badd6b58f70160a3e8
parentfe83bebc05228e838ed5cbbc62712ab50dd40e18 (diff)
SMB: fix validate negotiate info uninitialised memory use
An undersize validate negotiate info server response causes the client to use uninitialised memory for struct validate_negotiate_info_rsp comparisons of Dialect, SecurityMode and/or Capabilities members. Link: https://bugzilla.samba.org/show_bug.cgi?id=13092 Fixes: 7db0a6efdc3e ("SMB3: Work around mount failure when using SMB3 dialect to Macs") Signed-off-by: David Disseldorp <[email protected]> Reviewed-by: Pavel Shilovsky <[email protected]> Signed-off-by: Steve French <[email protected]>
-rw-r--r--fs/cifs/smb2pdu.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c
index 6b03e2d45d8e..ba58af747b43 100644
--- a/fs/cifs/smb2pdu.c
+++ b/fs/cifs/smb2pdu.c
@@ -727,7 +727,8 @@ int smb3_validate_negotiate(const unsigned int xid, struct cifs_tcon *tcon)
rsplen);
/* relax check since Mac returns max bufsize allowed on ioctl */
- if (rsplen > CIFSMaxBufSize)
+ if ((rsplen > CIFSMaxBufSize)
+ || (rsplen < sizeof(struct validate_negotiate_info_rsp)))
goto err_rsp_free;
}