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>

authored by David Disseldorp and committed by Steve French a2d9daad fe83bebc

+2 -1
+2 -1
fs/cifs/smb2pdu.c
··· 727 727 rsplen); 728 728 729 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 732 goto err_rsp_free; 732 733 } 733 734