ksmbd: set SMB2_SESSION_FLAG_ENCRYPT_DATA when enforcing data encryption for this...
authorNamjae Jeon <linkinjeon@kernel.org>
Fri, 28 Oct 2022 15:01:38 +0000 (00:01 +0900)
committerSteve French <stfrench@microsoft.com>
Sun, 11 Dec 2022 14:33:31 +0000 (08:33 -0600)
commit37ba7b005a7a4454046bd8659c7a9c5330552396
tree6e8b61635f600462b366cb69690060f797811609
parent76dcd734eca23168cb008912c0f69ff408905235
ksmbd: set SMB2_SESSION_FLAG_ENCRYPT_DATA when enforcing data encryption for this share

Currently, SMB2_SESSION_FLAG_ENCRYPT_DATA is always set session setup
response. Since this forces data encryption from the client, there is a
problem that data is always encrypted regardless of the use of the cifs
seal mount option. SMB2_SESSION_FLAG_ENCRYPT_DATA should be set according
to KSMBD_GLOBAL_FLAG_SMB2_ENCRYPTION flags, and in case of
KSMBD_GLOBAL_FLAG_SMB2_ENCRYPTION_OFF, encryption mode is turned off for
all connections.

Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/ksmbd/ksmbd_netlink.h
fs/ksmbd/smb2ops.c
fs/ksmbd/smb2pdu.c