]> git.itanic.dy.fi Git - linux-stable/commit
ksmbd: fix deadlock in ksmbd_find_crypto_ctx()
authorNamjae Jeon <linkinjeon@kernel.org>
Tue, 2 May 2023 23:44:14 +0000 (08:44 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 May 2023 09:50:29 +0000 (11:50 +0200)
commit4f9baa06674910876ce3e0b5fbe23214690d731d
tree212fc2a48356b9ec967d5283c82a5f00a274ec3b
parentbc77a6e933060e40a3f1efc564f6f6f1d11e93c1
ksmbd: fix deadlock in ksmbd_find_crypto_ctx()

[ Upstream commit 7b4323373d844954bb76e0e9f39c4e5fc785fa7b ]

Deadlock is triggered by sending multiple concurrent session setup
requests. It should be reused after releasing when getting ctx for crypto.
Multiple consecutive ctx uses cause deadlock while waiting for releasing
due to the limited number of ctx.

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