Skip to content

Commit fbf5c08

Browse files
namjaejeongregkh
authored andcommitted
ksmbd: fix Preauh_HashValue race condition
commit 44a3059 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>
1 parent 96a82e1 commit fbf5c08

1 file changed

Lines changed: 0 additions & 4 deletions

File tree

fs/smb/server/smb2pdu.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1842,8 +1842,6 @@ int smb2_sess_setup(struct ksmbd_work *work)
18421842
ksmbd_conn_set_good(conn);
18431843
sess->state = SMB2_SESSION_VALID;
18441844
}
1845-
kfree(sess->Preauth_HashValue);
1846-
sess->Preauth_HashValue = NULL;
18471845
} else if (conn->preferred_auth_mech == KSMBD_AUTH_NTLMSSP) {
18481846
if (negblob->MessageType == NtLmNegotiate) {
18491847
rc = ntlm_negotiate(work, negblob, negblob_len, rsp);
@@ -1870,8 +1868,6 @@ int smb2_sess_setup(struct ksmbd_work *work)
18701868
kfree(preauth_sess);
18711869
}
18721870
}
1873-
kfree(sess->Preauth_HashValue);
1874-
sess->Preauth_HashValue = NULL;
18751871
} else {
18761872
pr_info_ratelimited("Unknown NTLMSSP message type : 0x%x\n",
18771873
le32_to_cpu(negblob->MessageType));

0 commit comments

Comments
 (0)