]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
cifs: fix session state check in reconnect to avoid use-after-free issue
authorWinston Wen <wentao@uniontech.com>
Mon, 26 Jun 2023 03:42:56 +0000 (11:42 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 23 Aug 2023 15:32:29 +0000 (17:32 +0200)
commit759ffc164d95a32c09528766d74d9b4fb054e8f4
tree5d49a09e5374fc5e8c59bbe5c517da2690139941
parenteb79f8dfba343667f9a82a252743f4e8f67ce420
cifs: fix session state check in reconnect to avoid use-after-free issue

[ Upstream commit 99f280700b4cc02d5f141b8d15f8e9fad0418f65 ]

Don't collect exiting session in smb2_reconnect_server(), because it
will be released soon.

Note that the exiting session will stay in server->smb_ses_list until
it complete the cifs_free_ipc() and logoff() and then delete itself
from the list.

Signed-off-by: Winston Wen <wentao@uniontech.com>
Reviewed-by: Shyam Prasad N <sprasad@microsoft.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/smb/client/smb2pdu.c