Skip to content

Commit 02ea481

Browse files
committed
Merge: CVE-2024-53203 kernel: usb: typec: fix potential array underflow in ucsi_ccg_sync_control()
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-9/-/merge_requests/6068 JIRA: https://issues.redhat.com/browse/RHEL-72346 CVE: CVE-2024-53203 This fixes an possible underflow via debugfs on the user controlled "command" variable. Signed-off-by: Desnes Nunes <desnesn@redhat.com> Approved-by: José Ignacio Tornos Martínez <jtornosm@redhat.com> Approved-by: Bastien Nocera <bnocera@redhat.com> Approved-by: CKI KWF Bot <cki-ci-bot+kwf-gitlab-com@redhat.com> Merged-by: Rado Vrbovsky <rvrbovsk@redhat.com>
2 parents 780560f + 2f0df98 commit 02ea481

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

drivers/usb/typec/ucsi/ucsi_ccg.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -644,13 +644,18 @@ static int ucsi_ccg_sync_control(struct ucsi *ucsi, u64 command)
644644
uc->has_multiple_dp) {
645645
con_index = (uc->last_cmd_sent >> 16) &
646646
UCSI_CMD_CONNECTOR_MASK;
647+
if (con_index == 0) {
648+
ret = -EINVAL;
649+
goto unlock;
650+
}
647651
con = &uc->ucsi->connector[con_index - 1];
648652
ucsi_ccg_update_set_new_cam_cmd(uc, con, &command);
649653
}
650654

651655
ret = ucsi_sync_control_common(ucsi, command);
652656

653657
pm_runtime_put_sync(uc->dev);
658+
unlock:
654659
mutex_unlock(&uc->lock);
655660

656661
return ret;

0 commit comments

Comments
 (0)