Files
kernel_oneplus_sm8250/include/linux
RD Babiera 5aaa55cb56 usb: typec: altmodes/displayport: do not index invalid pin_assignments
commit af4db5a35a4ef7a68046883bfd12468007db38f1 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>
Signed-off-by: Ulrich Hecht <uli@kernel.org>
2025-08-13 09:44:37 +02:00
..
2024-02-23 08:12:39 +01:00
2022-10-26 13:19:32 +02:00
2023-08-08 19:49:17 +02:00
2023-12-20 15:38:01 +01:00
2021-12-08 08:50:13 +01:00
2024-04-13 12:50:14 +02:00
2021-01-30 13:32:12 +01:00
2021-05-22 10:59:50 +02:00
2022-10-26 13:19:35 +02:00
2021-03-04 09:39:44 +01:00
2022-08-25 11:15:23 +02:00
2021-02-07 14:48:38 +01:00
2023-09-23 10:47:59 +02:00
2021-06-30 08:48:18 -04:00
2025-04-04 11:11:26 +02:00
2023-06-21 15:39:57 +02:00
2023-02-22 12:47:17 +01:00
2025-04-04 11:35:21 +02:00
2023-11-28 16:46:33 +00:00
2023-10-25 11:16:20 +02:00
2023-10-25 11:16:20 +02:00
2021-12-14 10:18:04 +01:00
2024-07-05 09:00:35 +02:00
2024-02-23 08:12:39 +01:00
2021-12-14 10:18:06 +01:00