smb3: negotiate current dialect (SMB3.1.1) when version 3 or greater requested
authorSteve French <stfrench@microsoft.com>
Tue, 2 Feb 2021 06:03:58 +0000 (00:03 -0600)
committerSteve French <stfrench@microsoft.com>
Mon, 15 Feb 2021 16:33:34 +0000 (10:33 -0600)
commit6dffa4c22000595343fd676fd146a1318aab4073
tree1eed58797a5c8cbd9db0b952e2ec0992ddb63959
parentf40ddce88593482919761f74910f42f4b84c004b
smb3: negotiate current dialect (SMB3.1.1) when version 3 or greater requested

SMB3.1.1 is the newest, and preferred dialect, and is included in
the requested dialect list by default (ie if no vers= is specified
on mount) but it should also be requested if SMB3 or later is requested
(vers=3 instead of a specific dialect: vers=2.1, vers=3.02 or vers=3.0).

Currently specifying "vers=3" only requests smb3.0 and smb3.02 but this
patch fixes it to also request smb3.1.1 dialect, as it is the newest
and most secure dialect and is a "version 3 or later" dialect (the intent
of "vers=3").

Signed-off-by: Steve French <stfrench@microsoft.com>
Suggested-by: Pavel Shilovsky <pshilov@microsoft.com>
Reviewed-by: Shyam Prasad N <sprasad@microsoft.com>
Reviewed-by: Pavel Shilovsky <pshilov@microsoft.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/cifs/fs_context.c
fs/cifs/smb2pdu.c