]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ksmbd: fix race condition from parallel smb2 logoff requests
authorNamjae Jeon <linkinjeon@kernel.org>
Sun, 31 Dec 2023 07:13:05 +0000 (16:13 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 5 Jan 2024 14:18:33 +0000 (15:18 +0100)
commit6584ca894f30c9674fb1508fd16aa2cf909361b9
tree016b9edf309710cc9dd06a2fd6fef1755c125567
parentb3a843caed292c4f986d28edbfe1c171e7f5b8d6
ksmbd: fix race condition from parallel smb2 logoff requests

[ Upstream commit 7ca9da7d873ee8024e9548d3366101c2b6843eab ]

If parallel smb2 logoff requests come in before closing door, running
request count becomes more than 1 even though connection status is set to
KSMBD_SESS_NEED_RECONNECT. It can't get condition true, and sleep forever.
This patch fix race condition problem by returning error if connection
status was already set to KSMBD_SESS_NEED_RECONNECT.

Reported-by: luosili <rootlab@huawei.com>
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/smb/server/smb2pdu.c