]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.14-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 1 Mar 2023 16:12:48 +0000 (17:12 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 1 Mar 2023 16:12:48 +0000 (17:12 +0100)
added patches:
usb-core-don-t-hold-device-lock-while-reading-the-descriptors-sysfs-file.patch
usb-serial-option-add-support-for-vw-skoda-carstick-lte.patch

queue-4.14/series
queue-4.14/usb-core-don-t-hold-device-lock-while-reading-the-descriptors-sysfs-file.patch [new file with mode: 0644]
queue-4.14/usb-serial-option-add-support-for-vw-skoda-carstick-lte.patch [new file with mode: 0644]

index fd0a26c9336c443b1f07a6eb4363bdc363692fe9..449dbe3fdbb8dd1b182eb400a60b58b37ef2f658 100644 (file)
@@ -7,3 +7,5 @@ bpf-fix-subprog-verifier-bypass-by-div-mod-by-0-exception.patch
 bpf-fix-32-bit-src-register-truncation-on-div-mod.patch
 bpf-fix-truncation-handling-for-mod32-dst-reg-wrt-zero.patch
 dmaengine-sh-rcar-dmac-check-for-error-num-after-dma_set_max_seg_size.patch
+usb-serial-option-add-support-for-vw-skoda-carstick-lte.patch
+usb-core-don-t-hold-device-lock-while-reading-the-descriptors-sysfs-file.patch
diff --git a/queue-4.14/usb-core-don-t-hold-device-lock-while-reading-the-descriptors-sysfs-file.patch b/queue-4.14/usb-core-don-t-hold-device-lock-while-reading-the-descriptors-sysfs-file.patch
new file mode 100644 (file)
index 0000000..58ef83e
--- /dev/null
@@ -0,0 +1,72 @@
+From 45bf39f8df7f05efb83b302c65ae3b9bc92b7065 Mon Sep 17 00:00:00 2001
+From: Alan Stern <stern@rowland.harvard.edu>
+Date: Tue, 31 Jan 2023 15:49:04 -0500
+Subject: USB: core: Don't hold device lock while reading the "descriptors" sysfs file
+
+From: Alan Stern <stern@rowland.harvard.edu>
+
+commit 45bf39f8df7f05efb83b302c65ae3b9bc92b7065 upstream.
+
+Ever since commit 83e83ecb79a8 ("usb: core: get config and string
+descriptors for unauthorized devices") was merged in 2013, there has
+been no mechanism for reallocating the rawdescriptors buffers in
+struct usb_device after the initial enumeration.  Before that commit,
+the buffers would be deallocated when a device was deauthorized and
+reallocated when it was authorized and enumerated.
+
+This means that the locking in the read_descriptors() routine is not
+needed, since the buffers it reads will never be reallocated while the
+routine is running.  This locking can interfere with user programs
+trying to read a hub's descriptors via sysfs while new child devices
+of the hub are being initialized, since the hub is locked during this
+procedure.
+
+Since the locking in read_descriptors() hasn't been needed for over
+nine years, we can remove it.
+
+Reported-and-tested-by: Troels Liebe Bentsen <troels@connectedcars.dk>
+Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
+CC: stable@vger.kernel.org
+Link: https://lore.kernel.org/r/Y9l+wDTRbuZABzsE@rowland.harvard.edu
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/usb/core/hub.c   |    5 ++---
+ drivers/usb/core/sysfs.c |    5 -----
+ 2 files changed, 2 insertions(+), 8 deletions(-)
+
+--- a/drivers/usb/core/hub.c
++++ b/drivers/usb/core/hub.c
+@@ -2322,9 +2322,8 @@ static int usb_enumerate_device_otg(stru
+  * usb_enumerate_device - Read device configs/intfs/otg (usbcore-internal)
+  * @udev: newly addressed device (in ADDRESS state)
+  *
+- * This is only called by usb_new_device() and usb_authorize_device()
+- * and FIXME -- all comments that apply to them apply here wrt to
+- * environment.
++ * This is only called by usb_new_device() -- all comments that apply there
++ * apply here wrt to environment.
+  *
+  * If the device is WUSB and not authorized, we don't attempt to read
+  * the string descriptors, as they will be errored out by the device
+--- a/drivers/usb/core/sysfs.c
++++ b/drivers/usb/core/sysfs.c
+@@ -865,11 +865,7 @@ read_descriptors(struct file *filp, stru
+       size_t srclen, n;
+       int cfgno;
+       void *src;
+-      int retval;
+-      retval = usb_lock_device_interruptible(udev);
+-      if (retval < 0)
+-              return -EINTR;
+       /* The binary attribute begins with the device descriptor.
+        * Following that are the raw descriptor entries for all the
+        * configurations (config plus subsidiary descriptors).
+@@ -894,7 +890,6 @@ read_descriptors(struct file *filp, stru
+                       off -= srclen;
+               }
+       }
+-      usb_unlock_device(udev);
+       return count - nleft;
+ }
diff --git a/queue-4.14/usb-serial-option-add-support-for-vw-skoda-carstick-lte.patch b/queue-4.14/usb-serial-option-add-support-for-vw-skoda-carstick-lte.patch
new file mode 100644 (file)
index 0000000..286dbb7
--- /dev/null
@@ -0,0 +1,52 @@
+From 617c331d91077f896111044628c096802551dc66 Mon Sep 17 00:00:00 2001
+From: Florian Zumbiehl <florz@florz.de>
+Date: Mon, 6 Feb 2023 02:04:28 +0100
+Subject: USB: serial: option: add support for VW/Skoda "Carstick LTE"
+
+From: Florian Zumbiehl <florz@florz.de>
+
+commit 617c331d91077f896111044628c096802551dc66 upstream.
+
+Add support for VW/Skoda "Carstick LTE"
+
+D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
+P:  Vendor=1c9e ProdID=7605 Rev=02.00
+S:  Manufacturer=USB Modem
+S:  Product=USB Modem
+C:  #Ifs= 4 Cfg#= 1 Atr=e0 MxPwr=500mA
+I:  If#=0x0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none)
+I:  If#=0x1 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none)
+I:  If#=0x2 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none)
+I:  If#=0x3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=(none)
+
+The stick has AT command interfaces on interfaces 1, 2, and 3, and does PPP
+on interface 3.
+
+Signed-off-by: Florian Zumbiehl <florz@florz.de>
+Cc: stable@vger.kernel.org
+Signed-off-by: Johan Hovold <johan@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/usb/serial/option.c |    4 ++++
+ 1 file changed, 4 insertions(+)
+
+--- a/drivers/usb/serial/option.c
++++ b/drivers/usb/serial/option.c
+@@ -405,6 +405,8 @@ static void option_instat_callback(struc
+ #define LONGCHEER_VENDOR_ID                   0x1c9e
+ /* 4G Systems products */
++/* This one was sold as the VW and Skoda "Carstick LTE" */
++#define FOUR_G_SYSTEMS_PRODUCT_CARSTICK_LTE   0x7605
+ /* This is the 4G XS Stick W14 a.k.a. Mobilcom Debitel Surf-Stick *
+  * It seems to contain a Qualcomm QSC6240/6290 chipset            */
+ #define FOUR_G_SYSTEMS_PRODUCT_W14            0x9603
+@@ -1979,6 +1981,8 @@ static const struct usb_device_id option
+         .driver_info = RSVD(2) },
+       { USB_DEVICE(AIRPLUS_VENDOR_ID, AIRPLUS_PRODUCT_MCD650) },
+       { USB_DEVICE(TLAYTECH_VENDOR_ID, TLAYTECH_PRODUCT_TEU800) },
++      { USB_DEVICE(LONGCHEER_VENDOR_ID, FOUR_G_SYSTEMS_PRODUCT_CARSTICK_LTE),
++        .driver_info = RSVD(0) },
+       { USB_DEVICE(LONGCHEER_VENDOR_ID, FOUR_G_SYSTEMS_PRODUCT_W14),
+         .driver_info = NCTRL(0) | NCTRL(1) },
+       { USB_DEVICE(LONGCHEER_VENDOR_ID, FOUR_G_SYSTEMS_PRODUCT_W100),