]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.4-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 8 Jul 2025 15:19:54 +0000 (17:19 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 8 Jul 2025 15:19:54 +0000 (17:19 +0200)
added patches:
usb-typec-displayport-fix-potential-deadlock.patch

queue-5.4/series
queue-5.4/usb-typec-displayport-fix-potential-deadlock.patch [new file with mode: 0644]

index 7027a1a2eb51ec1cbcc28ad2d536759d5f498901..b150c2f8ca0ec0f9e67ebcb773719559504c67ca 100644 (file)
@@ -103,3 +103,4 @@ drm-i915-gt-fix-timeline-left-held-on-vma-alloc-erro.patch
 net-rose-fix-fall-through-warnings-for-clang.patch
 rose-fix-dangling-neighbour-pointers-in-rose_rt_devi.patch
 logitech-c-270-even-more-broken.patch
+usb-typec-displayport-fix-potential-deadlock.patch
diff --git a/queue-5.4/usb-typec-displayport-fix-potential-deadlock.patch b/queue-5.4/usb-typec-displayport-fix-potential-deadlock.patch
new file mode 100644 (file)
index 0000000..8772dde
--- /dev/null
@@ -0,0 +1,43 @@
+From 099cf1fbb8afc3771f408109f62bdec66f85160e Mon Sep 17 00:00:00 2001
+From: Andrei Kuchynski <akuchynski@chromium.org>
+Date: Tue, 24 Jun 2025 13:32:46 +0000
+Subject: usb: typec: displayport: Fix potential deadlock
+
+From: Andrei Kuchynski <akuchynski@chromium.org>
+
+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 <stable@kernel.org>
+Fixes: b4b38ffb38c9 ("usb: typec: displayport: Receive DP Status Update NAK request exit dp altmode")
+Signed-off-by: Andrei Kuchynski <akuchynski@chromium.org>
+Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
+Link: https://lore.kernel.org/r/20250624133246.3936737-1-akuchynski@chromium.org
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ 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
+@@ -289,8 +289,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;