Files
linux-stable-mirror/include/linux
RD BabieraandGreg Kroah-Hartman 621d5a3ef0 usb: typec: altmodes/displayport: do not index invalid pin_assignments
commit af4db5a35a upstream.

A poorly implemented DisplayPort Alt Mode port partner can indicate
that its pin assignment capabilities are greater than the maximum
value, DP_PIN_ASSIGN_F. In this case, calls to pin_assignment_show
will cause a BRK exception due to an out of bounds array access.

Prevent for loop in pin_assignment_show from accessing
invalid values in pin_assignments by adding DP_PIN_ASSIGN_MAX
value in typec_dp.h and using i < DP_PIN_ASSIGN_MAX as a loop
condition.

Fixes: 0e3bb7d689 ("usb: typec: Add driver for DisplayPort alternate mode")
Cc: stable <stable@kernel.org>
Signed-off-by: RD Babiera <rdbabiera@google.com>
Reviewed-by: Badhri Jagan Sridharan <badhri@google.com>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Link: https://lore.kernel.org/r/20250618224943.3263103-2-rdbabiera@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-07-10 15:57:43 +02:00
..
2024-01-25 14:52:51 -08:00
2024-07-05 09:14:50 +02:00
2023-12-20 15:17:37 +01:00
2024-12-14 19:51:34 +01:00
2024-04-10 16:19:07 +02:00
2025-07-10 15:57:42 +02:00
2024-04-10 16:18:55 +02:00
2024-01-25 14:52:33 -08:00
2025-06-04 14:38:07 +02:00
2025-03-13 12:50:47 +01:00
2024-06-16 13:39:27 +02:00
2025-04-10 14:31:55 +02:00
2023-11-28 16:56:21 +00:00
2025-02-01 18:23:59 +01:00
2025-04-10 14:31:49 +02:00
2023-12-13 18:36:35 +01:00
2025-06-04 14:38:08 +02:00
2024-10-17 15:11:06 +02:00