ksmbd: disable SMB2_GLOBAL_CAP_ENCRYPTION for SMB 3.1.1
authorMarcos Del Sol Vives <marcos@orca.pet>
Thu, 16 Dec 2021 10:37:22 +0000 (11:37 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 29 Dec 2021 11:28:57 +0000 (12:28 +0100)
commita2c144d17623984fdafa4634ecf4ab64580d29bb
treec8d88e9ec5bdc1ba572385f93702becd599ca4f2
parentf43ba86a821194778fcb1c10c0d68909d6a72889
ksmbd: disable SMB2_GLOBAL_CAP_ENCRYPTION for SMB 3.1.1

commit 83912d6d55be10d65b5268d1871168b9ebe1ec4b upstream.

According to the official Microsoft MS-SMB2 document section 3.3.5.4, this
flag should be used only for 3.0 and 3.0.2 dialects. Setting it for 3.1.1
is a violation of the specification.

This causes my Windows 10 client to detect an anomaly in the negotiation,
and disable encryption entirely despite being explicitly enabled in ksmbd,
causing all data transfers to go in plain text.

Fixes: e2f34481b24d ("cifsd: add server-side procedures for SMB3")
Cc: stable@vger.kernel.org # v5.15
Acked-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Marcos Del Sol Vives <marcos@orca.pet>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/ksmbd/smb2ops.c
fs/ksmbd/smb2pdu.c