]> git.itanic.dy.fi Git - linux-stable/commit
ksmbd: fix racy issue from smb2 close and logoff with multichannel
authorNamjae Jeon <linkinjeon@kernel.org>
Wed, 3 May 2023 05:03:40 +0000 (14:03 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 17 May 2023 09:53:57 +0000 (11:53 +0200)
commit4aba9ab6a007e41182454f84f95c0bddf7d6d7e1
tree504a3e1c060c1a00aadb3dc523460bf89af36373
parent502cf9709036d9305495876fa8c33c8a52541b15
ksmbd: fix racy issue from smb2 close and logoff with multichannel

[ Upstream commit abcc506a9a71976a8b4c9bf3ee6efd13229c1e19 ]

When smb client send concurrent smb2 close and logoff request
with multichannel connection, It can cause racy issue. logoff request
free tcon and can cause UAF issues in smb2 close. When receiving logoff
request with multichannel, ksmbd should wait until all remaning requests
complete as well as ones in the current connection, and then make
session expired.

Cc: stable@vger.kernel.org
Reported-by: zdi-disclosures@trendmicro.com # ZDI-CAN-20796 ZDI-CAN-20595
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/connection.c
fs/ksmbd/connection.h
fs/ksmbd/mgmt/tree_connect.c
fs/ksmbd/mgmt/user_session.c
fs/ksmbd/smb2pdu.c