Skip to content

Commit 44a3059

Browse files
namjaejeonsmfrench
authored andcommitted
ksmbd: fix Preauh_HashValue race condition
If client send multiple session setup requests to ksmbd, Preauh_HashValue race condition could happen. There is no need to free sess->Preauh_HashValue at session setup phase. It can be freed together with session at connection termination phase. Cc: [email protected] Reported-by: [email protected] # ZDI-CAN-27661 Signed-off-by: Namjae Jeon <[email protected]> Signed-off-by: Steve French <[email protected]>
1 parent ecd9d6b commit 44a3059

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
@@ -1852,8 +1852,6 @@ int smb2_sess_setup(struct ksmbd_work *work)
18521852
ksmbd_conn_set_good(conn);
18531853
sess->state = SMB2_SESSION_VALID;
18541854
}
1855-
kfree(sess->Preauth_HashValue);
1856-
sess->Preauth_HashValue = NULL;
18571855
} else if (conn->preferred_auth_mech == KSMBD_AUTH_NTLMSSP) {
18581856
if (negblob->MessageType == NtLmNegotiate) {
18591857
rc = ntlm_negotiate(work, negblob, negblob_len, rsp);
@@ -1880,8 +1878,6 @@ int smb2_sess_setup(struct ksmbd_work *work)
18801878
kfree(preauth_sess);
18811879
}
18821880
}
1883-
kfree(sess->Preauth_HashValue);
1884-
sess->Preauth_HashValue = NULL;
18851881
} else {
18861882
pr_info_ratelimited("Unknown NTLMSSP message type : 0x%x\n",
18871883
le32_to_cpu(negblob->MessageType));

0 commit comments

Comments
 (0)