mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2025-01-01 11:24:25 +08:00
ksmbd: fix memleak in session setup
commit 6d7cb549c2
upstream.
If client send session setup request with unknown NTLMSSP message type,
session that does not included channel can be created. It will cause
session memleak. because ksmbd_sessions_deregister() does not destroy
session if channel is not included. This patch return error response if
client send the request unknown NTLMSSP message type.
Cc: stable@vger.kernel.org
Reported-by: zdi-disclosures@trendmicro.com # ZDI-CAN-20593
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:
parent
227eb2689b
commit
671f21fbcb
@ -1786,6 +1786,10 @@ int smb2_sess_setup(struct ksmbd_work *work)
|
||||
}
|
||||
kfree(sess->Preauth_HashValue);
|
||||
sess->Preauth_HashValue = NULL;
|
||||
} else {
|
||||
pr_info_ratelimited("Unknown NTLMSSP message type : 0x%x\n",
|
||||
le32_to_cpu(negblob->MessageType));
|
||||
rc = -EINVAL;
|
||||
}
|
||||
} else {
|
||||
/* TODO: need one more negotiation */
|
||||
|
Loading…
Reference in New Issue
Block a user