From c5424409595c97e5fc59c9e695aec13a08d33a63 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Tue, 8 Jul 2025 17:20:01 +0200 Subject: [PATCH] 5.10-stable patches added patches: usb-typec-displayport-fix-potential-deadlock.patch --- queue-5.10/series | 1 + ...c-displayport-fix-potential-deadlock.patch | 43 +++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 queue-5.10/usb-typec-displayport-fix-potential-deadlock.patch diff --git a/queue-5.10/series b/queue-5.10/series index 1f0c4cd5ee..71b2b1a2a7 100644 --- a/queue-5.10/series +++ b/queue-5.10/series @@ -136,3 +136,4 @@ dpaa2-eth-fix-xdp_rxq_info-leak.patch xhci-dbctty-disable-echo-flag-by-default.patch xhci-dbc-flush-queued-requests-before-stopping-dbc.patch logitech-c-270-even-more-broken.patch +usb-typec-displayport-fix-potential-deadlock.patch diff --git a/queue-5.10/usb-typec-displayport-fix-potential-deadlock.patch b/queue-5.10/usb-typec-displayport-fix-potential-deadlock.patch new file mode 100644 index 0000000000..5bd50269ff --- /dev/null +++ b/queue-5.10/usb-typec-displayport-fix-potential-deadlock.patch @@ -0,0 +1,43 @@ +From 099cf1fbb8afc3771f408109f62bdec66f85160e Mon Sep 17 00:00:00 2001 +From: Andrei Kuchynski +Date: Tue, 24 Jun 2025 13:32:46 +0000 +Subject: usb: typec: displayport: Fix potential deadlock + +From: Andrei Kuchynski + +commit 099cf1fbb8afc3771f408109f62bdec66f85160e upstream. + +The deadlock can occur due to a recursive lock acquisition of +`cros_typec_altmode_data::mutex`. +The call chain is as follows: +1. cros_typec_altmode_work() acquires the mutex +2. typec_altmode_vdm() -> dp_altmode_vdm() -> +3. typec_altmode_exit() -> cros_typec_altmode_exit() +4. cros_typec_altmode_exit() attempts to acquire the mutex again + +To prevent this, defer the `typec_altmode_exit()` call by scheduling +it rather than calling it directly from within the mutex-protected +context. + +Cc: stable +Fixes: b4b38ffb38c9 ("usb: typec: displayport: Receive DP Status Update NAK request exit dp altmode") +Signed-off-by: Andrei Kuchynski +Reviewed-by: Heikki Krogerus +Link: https://lore.kernel.org/r/20250624133246.3936737-1-akuchynski@chromium.org +Signed-off-by: Greg Kroah-Hartman +--- + drivers/usb/typec/altmodes/displayport.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +--- a/drivers/usb/typec/altmodes/displayport.c ++++ b/drivers/usb/typec/altmodes/displayport.c +@@ -305,8 +305,7 @@ static int dp_altmode_vdm(struct typec_a + case CMDT_RSP_NAK: + switch (cmd) { + case DP_CMD_STATUS_UPDATE: +- if (typec_altmode_exit(alt)) +- dev_err(&dp->alt->dev, "Exit Mode Failed!\n"); ++ dp->state = DP_STATE_EXIT; + break; + case DP_CMD_CONFIGURE: + dp->data.conf = 0; -- 2.47.2