mirror of
https://github.com/hardkernel/linux.git
synced 2026-03-25 20:10:23 +09:00
ksmbd: fix out of bounds in smb3_decrypt_req()
[ Upstream commit dc318846f3 ]
smb3_decrypt_req() validate if pdu_length is smaller than
smb2_transform_hdr size.
Reported-by: zdi-disclosures@trendmicro.com # ZDI-CAN-21589
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
20d449a087
commit
82373d1b76
@@ -8649,7 +8649,8 @@ int smb3_decrypt_req(struct ksmbd_work *work)
|
||||
struct smb2_transform_hdr *tr_hdr = (struct smb2_transform_hdr *)buf;
|
||||
int rc = 0;
|
||||
|
||||
if (buf_data_size < sizeof(struct smb2_hdr)) {
|
||||
if (pdu_length < sizeof(struct smb2_transform_hdr) ||
|
||||
buf_data_size < sizeof(struct smb2_hdr)) {
|
||||
pr_err("Transform message is too small (%u)\n",
|
||||
pdu_length);
|
||||
return -ECONNABORTED;
|
||||
|
||||
Reference in New Issue
Block a user