diff options
author | David Disseldorp <ddiss@suse.de> | 2017-10-20 08:49:38 -0400 |
---|---|---|
committer | Steve French <smfrench@gmail.com> | 2017-10-25 14:04:25 -0400 |
commit | a2d9daad1d2dfbd307ab158044d1c323d7babbde (patch) | |
tree | 930b847cdec5700e372ad6badd6b58f70160a3e8 | |
parent | fe83bebc05228e838ed5cbbc62712ab50dd40e18 (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 <ddiss@suse.de>
Reviewed-by: Pavel Shilovsky <pshilov@microsoft.com>
Signed-off-by: Steve French <smfrench@gmail.com>
-rw-r--r-- | fs/cifs/smb2pdu.c | 3 |
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) | |||
727 | rsplen); | 727 | rsplen); |
728 | 728 | ||
729 | /* relax check since Mac returns max bufsize allowed on ioctl */ | 729 | /* relax check since Mac returns max bufsize allowed on ioctl */ |
730 | if (rsplen > CIFSMaxBufSize) | 730 | if ((rsplen > CIFSMaxBufSize) |
731 | || (rsplen < sizeof(struct validate_negotiate_info_rsp))) | ||
731 | goto err_rsp_free; | 732 | goto err_rsp_free; |
732 | } | 733 | } |
733 | 734 | ||