ksmbd: fix memleak in session setup
authorNamjae Jeon <linkinjeon@kernel.org>
Tue, 2 May 2023 23:26:45 +0000 (08:26 +0900)
committerSteve French <stfrench@microsoft.com>
Thu, 4 May 2023 04:03:01 +0000 (23:03 -0500)
commit6d7cb549c2ca20e1f07593f15e936fd54b763028
treef104c31c75068c9c5fb72676dfe6b621a57b10f8
parent1ae78a14516b9372e4c90a89ac21b259339a3a3a
ksmbd: fix memleak in session setup

If client send session setup request with unknown NTLMSSP message type,
session that does not included channel can be created. It will cause
session memleak. because ksmbd_sessions_deregister() does not destroy
session if channel is not included. This patch return error response if
client send the request unknown NTLMSSP message type.

Cc: stable@vger.kernel.org
Reported-by: zdi-disclosures@trendmicro.com # ZDI-CAN-20593
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/ksmbd/smb2pdu.c