Skip to content

Commit 2fc9fef

Browse files
SeanHeelanSteve French
authored andcommitted
ksmbd: fix use-after-free in session logoff
The sess->user object can currently be in use by another thread, for example if another connection has sent a session setup request to bind to the session being free'd. The handler for that connection could be in the smb2_sess_setup function which makes use of sess->user. Cc: stable@vger.kernel.org Signed-off-by: Sean Heelan <seanheelan@gmail.com> Acked-by: Namjae Jeon <linkinjeon@kernel.org> Signed-off-by: Steve French <stfrench@microsoft.com>
1 parent e86e913 commit 2fc9fef

File tree

1 file changed

+0
-4
lines changed

1 file changed

+0
-4
lines changed

fs/smb/server/smb2pdu.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2249,10 +2249,6 @@ int smb2_session_logoff(struct ksmbd_work *work)
22492249
sess->state = SMB2_SESSION_EXPIRED;
22502250
up_write(&conn->session_lock);
22512251

2252-
if (sess->user) {
2253-
ksmbd_free_user(sess->user);
2254-
sess->user = NULL;
2255-
}
22562252
ksmbd_all_conn_set_status(sess_id, KSMBD_SESS_NEED_SETUP);
22572253

22582254
rsp->StructureSize = cpu_to_le16(4);

0 commit comments

Comments
 (0)