diff options
| author | Dan Carpenter <[email protected]> | 2024-11-04 17:16:42 +0000 |
|---|---|---|
| committer | Greg Kroah-Hartman <[email protected]> | 2024-11-05 12:55:19 +0000 |
| commit | 7dd08a0b4193087976db6b3ee7807de7e8316f96 (patch) | |
| tree | 151b54a3b2b977ceae394ff7f024aabb42b41650 /rust/helpers/helpers.c | |
| parent | usb: dwc3: fix fault at system suspend if device was already runtime suspended (diff) | |
| download | kernel-7dd08a0b4193087976db6b3ee7807de7e8316f96.tar.gz kernel-7dd08a0b4193087976db6b3ee7807de7e8316f96.zip | |
usb: typec: fix potential out of bounds in ucsi_ccg_update_set_new_cam_cmd()
The "*cmd" variable can be controlled by the user via debugfs. That means
"new_cam" can be as high as 255 while the size of the uc->updated[] array
is UCSI_MAX_ALTMODES (30).
The call tree is:
ucsi_cmd() // val comes from simple_attr_write_xsigned()
-> ucsi_send_command()
-> ucsi_send_command_common()
-> ucsi_run_command() // calls ucsi->ops->sync_control()
-> ucsi_ccg_sync_control()
Fixes: 170a6726d0e2 ("usb: typec: ucsi: add support for separate DP altmode devices")
Cc: stable <[email protected]>
Signed-off-by: Dan Carpenter <[email protected]>
Reviewed-by: Heikki Krogerus <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Greg Kroah-Hartman <[email protected]>
Diffstat (limited to 'rust/helpers/helpers.c')
0 files changed, 0 insertions, 0 deletions
