]> git.itanic.dy.fi Git - linux-stable/commit
ksmbd: fix racy issue while destroying session on multichannel
authorNamjae Jeon <linkinjeon@kernel.org>
Mon, 25 Jul 2022 04:36:52 +0000 (13:36 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 May 2023 09:50:28 +0000 (11:50 +0200)
commitbc77a6e933060e40a3f1efc564f6f6f1d11e93c1
tree95ccdc78e31296759bfd5f59fba2833ed47932e7
parenta89ff57e4da11ba770c0ecd8a20cdf0c624a8692
ksmbd: fix racy issue while destroying session on multichannel

[ Upstream commit af7c39d971e43cd0af488729bca362427ad99488 ]

After multi-channel connection with windows, Several channels of
session are connected. Among them, if there is a problem in one channel,
Windows connects again after disconnecting the channel. In this process,
the session is released and a kernel oop can occurs while processing
requests to other channels. When the channel is disconnected, if other
channels still exist in the session after deleting the channel from
the channel list in the session, the session should not be released.
Finally, the session will be released after all channels are disconnected.

Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Reviewed-by: Hyunchul Lee <hyc.lee@gmail.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Stable-dep-of: 7b4323373d84 ("ksmbd: fix deadlock in ksmbd_find_crypto_ctx()")
Signed-off-by: Sasha Levin <sashal@kernel.org>
12 files changed:
fs/ksmbd/auth.c
fs/ksmbd/auth.h
fs/ksmbd/connection.h
fs/ksmbd/mgmt/tree_connect.c
fs/ksmbd/mgmt/tree_connect.h
fs/ksmbd/mgmt/user_session.c
fs/ksmbd/mgmt/user_session.h
fs/ksmbd/oplock.c
fs/ksmbd/smb2pdu.c
fs/ksmbd/smb_common.h
fs/ksmbd/vfs.c
fs/ksmbd/vfs_cache.c