]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
6.10-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 16 Sep 2024 07:45:41 +0000 (09:45 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 16 Sep 2024 07:45:41 +0000 (09:45 +0200)
added patches:
usb-typec-ucsi-only-set-number-of-plug-altmodes-after-registration.patch

queue-6.10/series
queue-6.10/usb-typec-ucsi-only-set-number-of-plug-altmodes-after-registration.patch [new file with mode: 0644]

index 8eecdd88df0e44a8bcbaf93a88c21ef597408bb1..a9f34492ea1b8a290b19c29b03b1932cde126066 100644 (file)
@@ -118,3 +118,4 @@ drm-xe-display-fix-compat-is_display_step-range-end.patch
 cifs-fix-signature-miscalculation.patch
 pinctrl-meteorlake-add-arrow-lake-h-u-acpi-id.patch
 asoc-meson-axg-card-fix-use-after-free.patch
+usb-typec-ucsi-only-set-number-of-plug-altmodes-after-registration.patch
diff --git a/queue-6.10/usb-typec-ucsi-only-set-number-of-plug-altmodes-after-registration.patch b/queue-6.10/usb-typec-ucsi-only-set-number-of-plug-altmodes-after-registration.patch
new file mode 100644 (file)
index 0000000..2cbdb32
--- /dev/null
@@ -0,0 +1,48 @@
+From 22d96a285449ba78abeaf3e197caca46bc24f8e5 Mon Sep 17 00:00:00 2001
+From: Jameson Thies <jthies@google.com>
+Date: Tue, 25 Jun 2024 00:46:07 +0000
+Subject: usb: typec: ucsi: Only set number of plug altmodes after registration
+
+From: Jameson Thies <jthies@google.com>
+
+commit 22d96a285449ba78abeaf3e197caca46bc24f8e5 upstream.
+
+Move the setting of the plug's number of alternate modes into the
+same condition as the plug's registration to prevent dereferencing the
+connector's plug pointer while it is null.
+
+Fixes: c313a44ac9cd ("usb: typec: ucsi: Always set number of alternate modes")
+Suggested-by: Jon Hunter <jonathanh@nvidia.com>
+Signed-off-by: Jameson Thies <jthies@google.com>
+Reviewed-by: Benson Leung <bleung@chromium.org>
+Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
+Tested-by: Jon Hunter <jonathanh@nvidia.com>
+Reviewed-by: Jon Hunter <jonathanh@nvidia.com>
+Link: https://lore.kernel.org/r/20240625004607.3223757-1-jthies@google.com
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/usb/typec/ucsi/ucsi.c |   12 ++++++------
+ 1 file changed, 6 insertions(+), 6 deletions(-)
+
+--- a/drivers/usb/typec/ucsi/ucsi.c
++++ b/drivers/usb/typec/ucsi/ucsi.c
+@@ -1176,13 +1176,13 @@ static int ucsi_check_cable(struct ucsi_
+               ret = ucsi_register_altmodes(con, UCSI_RECIPIENT_SOP_P);
+               if (ret < 0)
+                       return ret;
+-      }
+-      if (con->plug_altmode[0]) {
+-              num_plug_am = ucsi_get_num_altmode(con->plug_altmode);
+-              typec_plug_set_num_altmodes(con->plug, num_plug_am);
+-      } else {
+-              typec_plug_set_num_altmodes(con->plug, 0);
++              if (con->plug_altmode[0]) {
++                      num_plug_am = ucsi_get_num_altmode(con->plug_altmode);
++                      typec_plug_set_num_altmodes(con->plug, num_plug_am);
++              } else {
++                      typec_plug_set_num_altmodes(con->plug, 0);
++              }
+       }
+       return 0;