Skip to content

Commit dc31884

Browse files
namjaejeonsmfrench
authored andcommitted
ksmbd: fix out of bounds in smb3_decrypt_req()
smb3_decrypt_req() validate if pdu_length is smaller than smb2_transform_hdr size. Reported-by: [email protected] # ZDI-CAN-21589 Signed-off-by: Namjae Jeon <[email protected]> Signed-off-by: Steve French <[email protected]>
1 parent 2b57a43 commit dc31884

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

fs/smb/server/smb2pdu.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8614,7 +8614,8 @@ int smb3_decrypt_req(struct ksmbd_work *work)
86148614
struct smb2_transform_hdr *tr_hdr = smb2_get_msg(buf);
86158615
int rc = 0;
86168616

8617-
if (buf_data_size < sizeof(struct smb2_hdr)) {
8617+
if (pdu_length < sizeof(struct smb2_transform_hdr) ||
8618+
buf_data_size < sizeof(struct smb2_hdr)) {
86188619
pr_err("Transform message is too small (%u)\n",
86198620
pdu_length);
86208621
return -ECONNABORTED;

0 commit comments

Comments
 (0)