SMB3: Fix length checking of SMB3.11 negotiate request
authorSteve French <smfrench@gmail.com>
Sun, 8 Apr 2018 21:14:31 +0000 (16:14 -0500)
committerSteve French <smfrench@gmail.com>
Thu, 12 Apr 2018 21:52:38 +0000 (16:52 -0500)
commit136ff1b4b65edf09b6b7173ba94ad53347d3aa83
treea3637b5dc7de1c91869b111f10eed9736f8a7d96
parentf2f176b418da96ae030c2f312c0ddb0e7b6ead21
SMB3: Fix length checking of SMB3.11 negotiate request

The length checking for SMB3.11 negotiate request includes
"negotiate contexts" which caused a buffer validation problem
and a confusing warning message on SMB3.11 mount e.g.:

     SMB2 server sent bad RFC1001 len 236 not 170

Fix the length checking for SMB3.11 negotiate to account for
the new negotiate context so that we don't log a warning on
SMB3.11 mount by default but do log warnings if lengths returned
by the server are incorrect.

CC: Stable <stable@vger.kernel.org>
Signed-off-by: Steve French <smfrench@gmail.com>
Reviewed-by: Aurelien Aptel <aaptel@suse.com>
Reviewed-by: Pavel Shilovsky <pshilov@microsoft.com>
fs/cifs/smb2misc.c
fs/cifs/smb2pdu.h