mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 10:58:48 +09:00
ksmbd: fix Preauh_HashValue race condition
commit 44a3059c4c8cc635a1fb2afd692d0730ca1ba4b6 upstream. 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: stable@vger.kernel.org Reported-by: zdi-disclosures@trendmicro.com # ZDI-CAN-27661 Signed-off-by: Namjae Jeon <linkinjeon@kernel.org> Signed-off-by: Steve French <stfrench@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
d79c8bebaa
commit
b69fd87076
@@ -1831,8 +1831,6 @@ int smb2_sess_setup(struct ksmbd_work *work)
|
||||
ksmbd_conn_set_good(conn);
|
||||
sess->state = SMB2_SESSION_VALID;
|
||||
}
|
||||
kfree(sess->Preauth_HashValue);
|
||||
sess->Preauth_HashValue = NULL;
|
||||
} else if (conn->preferred_auth_mech == KSMBD_AUTH_NTLMSSP) {
|
||||
if (negblob->MessageType == NtLmNegotiate) {
|
||||
rc = ntlm_negotiate(work, negblob, negblob_len, rsp);
|
||||
@@ -1859,8 +1857,6 @@ int smb2_sess_setup(struct ksmbd_work *work)
|
||||
kfree(preauth_sess);
|
||||
}
|
||||
}
|
||||
kfree(sess->Preauth_HashValue);
|
||||
sess->Preauth_HashValue = NULL;
|
||||
} else {
|
||||
pr_info_ratelimited("Unknown NTLMSSP message type : 0x%x\n",
|
||||
le32_to_cpu(negblob->MessageType));
|
||||
|
||||
Reference in New Issue
Block a user