]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ksmbd: fix r_count dec/increment mismatch
authorNamjae Jeon <linkinjeon@kernel.org>
Mon, 24 Mar 2025 15:00:24 +0000 (00:00 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 10 Apr 2025 12:39:27 +0000 (14:39 +0200)
commit457db486203c90e10c3efc87fd45cc7000b1cd36
tree54fe3bfdd9f585086e80c711105dd7d94e37a238
parente0b32b6f0f13ea6ec878afb26f4f273275d4786f
ksmbd: fix r_count dec/increment mismatch

[ Upstream commit ddb7ea36ba7129c2ed107e2186591128618864e1 ]

r_count is only increased when there is an oplock break wait,
so r_count inc/decrement are not paired. This can cause r_count
to become negative, which can lead to a problem where the ksmbd
thread does not terminate.

Fixes: 3aa660c05924 ("ksmbd: prevent connection release during oplock break notification")
Reported-by: Norbert Szetei <norbert@doyensec.com>
Tested-by: Norbert Szetei <norbert@doyensec.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/oplock.c