Skip to content

Commit b052dd1

Browse files
committed
Merge: [CVE-2024-50151] smb: client: fix OOBs when building SMB2_IOCTL request
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-9/-/merge_requests/5810 JIRA: https://issues.redhat.com/browse/RHEL-66476 CVE: CVE-2024-50151 Signed-off-by: Paulo Alcantara <[email protected]> Approved-by: Chris von Recklinghausen <[email protected]> Approved-by: Benjamin Coddington <[email protected]> Approved-by: CKI KWF Bot <[email protected]> Merged-by: Rado Vrbovsky <[email protected]>
2 parents df57b05 + 03e21a5 commit b052dd1

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

fs/smb/client/smb2pdu.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3300,6 +3300,15 @@ SMB2_ioctl_init(struct cifs_tcon *tcon, struct TCP_Server_Info *server,
33003300
return rc;
33013301

33023302
if (indatalen) {
3303+
unsigned int len;
3304+
3305+
if (WARN_ON_ONCE(smb3_encryption_required(tcon) &&
3306+
(check_add_overflow(total_len - 1,
3307+
ALIGN(indatalen, 8), &len) ||
3308+
len > MAX_CIFS_SMALL_BUFFER_SIZE))) {
3309+
cifs_small_buf_release(req);
3310+
return -EIO;
3311+
}
33033312
/*
33043313
* indatalen is usually small at a couple of bytes max, so
33053314
* just allocate through generic pool

0 commit comments

Comments
 (0)