]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ksmbd: fix encryption failure issue for session logoff response
authorNamjae Jeon <linkinjeon@kernel.org>
Mon, 18 Dec 2023 15:33:16 +0000 (00:33 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 23 Dec 2023 09:41:53 +0000 (10:41 +0100)
commit4d796ff8995adb71b265d64c533c412dfae754ab
tree4237044a4dbb3ea2998a5d8672e61117795dab07
parente925de7defff35caee89399f62e48759a229a95c
ksmbd: fix encryption failure issue for session logoff response

[ Upstream commit af705ef2b0ded0d8f54c238fdf3c17a1d47ad924 ]

If client send encrypted session logoff request on seal mount,
Encryption for that response fails.

ksmbd: Could not get encryption key
CIFS: VFS: cifs_put_smb_ses: Session Logoff failure rc=-512

Session lookup fails in ksmbd_get_encryption_key() because sess->state is
set to SMB2_SESSION_EXPIRED in session logoff. There is no need to do
session lookup again to encrypt the response. This patch change to use
ksmbd_session in ksmbd_work.

Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/ksmbd/auth.c
fs/ksmbd/auth.h
fs/ksmbd/smb2pdu.c