diff options
author | Namjae Jeon <linkinjeon@kernel.org> | 2023-05-03 16:45:00 +0900 |
---|---|---|
committer | Steve French <stfrench@microsoft.com> | 2023-05-03 23:03:01 -0500 |
commit | f5c779b7ddbda30866cf2a27c63e34158f858c73 (patch) | |
tree | d306574cebf6e016eb339ec2bf44515f7eaac7cb /fs/ksmbd/mgmt | |
parent | 3ac00a2ab69b34189942afa9e862d5170cdcb018 (diff) | |
download | linux-stable-f5c779b7ddbda30866cf2a27c63e34158f858c73.tar.gz linux-stable-f5c779b7ddbda30866cf2a27c63e34158f858c73.tar.bz2 linux-stable-f5c779b7ddbda30866cf2a27c63e34158f858c73.zip |
ksmbd: fix racy issue from session setup and logoff
This racy issue is triggered by sending concurrent session setup and
logoff requests. This patch does not set connection status as
KSMBD_SESS_GOOD if state is KSMBD_SESS_NEED_RECONNECT in session setup.
And relookup session to validate if session is deleted in logoff.
Cc: stable@vger.kernel.org
Reported-by: zdi-disclosures@trendmicro.com # ZDI-CAN-20481, ZDI-CAN-20590, ZDI-CAN-20596
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'fs/ksmbd/mgmt')
-rw-r--r-- | fs/ksmbd/mgmt/user_session.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/ksmbd/mgmt/user_session.c b/fs/ksmbd/mgmt/user_session.c index 1ca2aae4c299..68d40025cfbf 100644 --- a/fs/ksmbd/mgmt/user_session.c +++ b/fs/ksmbd/mgmt/user_session.c @@ -315,6 +315,7 @@ static struct ksmbd_session *__session_create(int protocol) if (ksmbd_init_file_table(&sess->file_table)) goto error; + sess->state = SMB2_SESSION_IN_PROGRESS; set_session_flag(sess, protocol); xa_init(&sess->tree_conns); xa_init(&sess->ksmbd_chann_list); |