]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.4-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 30 Jan 2025 11:43:58 +0000 (12:43 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 30 Jan 2025 11:43:58 +0000 (12:43 +0100)
added patches:
input-atkbd-map-f23-key-to-support-default-copilot-shortcut.patch
input-xpad-add-support-for-wooting-two-he-arm.patch
input-xpad-add-unofficial-xbox-360-wireless-receiver-clone.patch
revert-usb-gadget-u_serial-disable-ep-before-setting-port-to-null-to-fix-the-crash-caused-by-port-being-null.patch
usb-serial-quatech2-fix-null-ptr-deref-in-qt2_process_read_urb.patch

queue-5.4/input-atkbd-map-f23-key-to-support-default-copilot-shortcut.patch [new file with mode: 0644]
queue-5.4/input-xpad-add-support-for-wooting-two-he-arm.patch [new file with mode: 0644]
queue-5.4/input-xpad-add-unofficial-xbox-360-wireless-receiver-clone.patch [new file with mode: 0644]
queue-5.4/revert-usb-gadget-u_serial-disable-ep-before-setting-port-to-null-to-fix-the-crash-caused-by-port-being-null.patch [new file with mode: 0644]
queue-5.4/series
queue-5.4/usb-serial-quatech2-fix-null-ptr-deref-in-qt2_process_read_urb.patch [new file with mode: 0644]

diff --git a/queue-5.4/input-atkbd-map-f23-key-to-support-default-copilot-shortcut.patch b/queue-5.4/input-atkbd-map-f23-key-to-support-default-copilot-shortcut.patch
new file mode 100644 (file)
index 0000000..bc6ba57
--- /dev/null
@@ -0,0 +1,45 @@
+From 907bc9268a5a9f823ffa751957a5c1dd59f83f42 Mon Sep 17 00:00:00 2001
+From: Mark Pearson <mpearson-lenovo@squebb.ca>
+Date: Mon, 20 Jan 2025 20:24:08 -0800
+Subject: Input: atkbd - map F23 key to support default copilot shortcut
+
+From: Mark Pearson <mpearson-lenovo@squebb.ca>
+
+commit 907bc9268a5a9f823ffa751957a5c1dd59f83f42 upstream.
+
+Microsoft defined Meta+Shift+F23 as the Copilot shortcut instead of a
+dedicated keycode, and multiple vendors have their keyboards emit this
+sequence in response to users pressing a dedicated "Copilot" key.
+Unfortunately the default keymap table in atkbd does not map scancode
+0x6e (F23) and so the key combination does not work even if userspace
+is ready to handle it.
+
+Because this behavior is common between multiple vendors and the
+scancode is currently unused map 0x6e to keycode 193 (KEY_F23) so that
+key sequence is generated properly.
+
+MS documentation for the scan code:
+https://learn.microsoft.com/en-us/windows/win32/inputdev/about-keyboard-input#scan-codes
+Confirmed on Lenovo, HP and Dell machines by Canonical.
+Tested on Lenovo T14s G6 AMD.
+
+Signed-off-by: Mark Pearson <mpearson-lenovo@squebb.ca>
+Link: https://lore.kernel.org/r/20250107034554.25843-1-mpearson-lenovo@squebb.ca
+Cc: stable@vger.kernel.org
+Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/input/keyboard/atkbd.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/input/keyboard/atkbd.c
++++ b/drivers/input/keyboard/atkbd.c
+@@ -84,7 +84,7 @@ static const unsigned short atkbd_set2_k
+         0, 46, 45, 32, 18,  5,  4, 95,  0, 57, 47, 33, 20, 19,  6,183,
+         0, 49, 48, 35, 34, 21,  7,184,  0,  0, 50, 36, 22,  8,  9,185,
+         0, 51, 37, 23, 24, 11, 10,  0,  0, 52, 53, 38, 39, 25, 12,  0,
+-        0, 89, 40,  0, 26, 13,  0,  0, 58, 54, 28, 27,  0, 43,  0, 85,
++        0, 89, 40,  0, 26, 13,  0,193, 58, 54, 28, 27,  0, 43,  0, 85,
+         0, 86, 91, 90, 92,  0, 14, 94,  0, 79,124, 75, 71,121,  0,  0,
+        82, 83, 80, 76, 77, 72,  1, 69, 87, 78, 81, 74, 55, 73, 70, 99,
diff --git a/queue-5.4/input-xpad-add-support-for-wooting-two-he-arm.patch b/queue-5.4/input-xpad-add-support-for-wooting-two-he-arm.patch
new file mode 100644 (file)
index 0000000..68afb51
--- /dev/null
@@ -0,0 +1,31 @@
+From 222f3390c15c4452a9f7e26f5b7d9138e75d00d5 Mon Sep 17 00:00:00 2001
+From: Jack Greiner <jack@emoss.org>
+Date: Fri, 17 Jan 2025 16:51:58 -0800
+Subject: Input: xpad - add support for wooting two he (arm)
+
+From: Jack Greiner <jack@emoss.org>
+
+commit 222f3390c15c4452a9f7e26f5b7d9138e75d00d5 upstream.
+
+Add Wooting Two HE (ARM) to the list of supported devices.
+
+Signed-off-by: Jack Greiner <jack@emoss.org>
+Signed-off-by: Pavel Rojtberg <rojtberg@gmail.com>
+Link: https://lore.kernel.org/r/20250107192830.414709-3-rojtberg@gmail.com
+Cc: stable@vger.kernel.org
+Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/input/joystick/xpad.c |    1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/drivers/input/joystick/xpad.c
++++ b/drivers/input/joystick/xpad.c
+@@ -345,6 +345,7 @@ static const struct xpad_device {
+       { 0x31e3, 0x1200, "Wooting Two", 0, XTYPE_XBOX360 },
+       { 0x31e3, 0x1210, "Wooting Lekker", 0, XTYPE_XBOX360 },
+       { 0x31e3, 0x1220, "Wooting Two HE", 0, XTYPE_XBOX360 },
++      { 0x31e3, 0x1230, "Wooting Two HE (ARM)", 0, XTYPE_XBOX360 },
+       { 0x31e3, 0x1300, "Wooting 60HE (AVR)", 0, XTYPE_XBOX360 },
+       { 0x31e3, 0x1310, "Wooting 60HE (ARM)", 0, XTYPE_XBOX360 },
+       { 0x3285, 0x0607, "Nacon GC-100", 0, XTYPE_XBOX360 },
diff --git a/queue-5.4/input-xpad-add-unofficial-xbox-360-wireless-receiver-clone.patch b/queue-5.4/input-xpad-add-unofficial-xbox-360-wireless-receiver-clone.patch
new file mode 100644 (file)
index 0000000..95e1afe
--- /dev/null
@@ -0,0 +1,35 @@
+From e4940fe6322c851659c17852b671c6e7b1aa9f56 Mon Sep 17 00:00:00 2001
+From: Nilton Perim Neto <niltonperimneto@gmail.com>
+Date: Fri, 17 Jan 2025 09:34:18 -0800
+Subject: Input: xpad - add unofficial Xbox 360 wireless receiver clone
+
+From: Nilton Perim Neto <niltonperimneto@gmail.com>
+
+commit e4940fe6322c851659c17852b671c6e7b1aa9f56 upstream.
+
+Although it mimics the Microsoft's VendorID, it is in fact a clone.
+Taking into account that the original Microsoft Receiver is not being
+manufactured anymore, this drive can solve dpad issues encontered by
+those who still use the original 360 Wireless controller
+but are using a receiver clone.
+
+Signed-off-by: Nilton Perim Neto <niltonperimneto@gmail.com>
+Signed-off-by: Pavel Rojtberg <rojtberg@gmail.com>
+Link: https://lore.kernel.org/r/20250107192830.414709-12-rojtberg@gmail.com
+Cc: stable@vger.kernel.org
+Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/input/joystick/xpad.c |    1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/drivers/input/joystick/xpad.c
++++ b/drivers/input/joystick/xpad.c
+@@ -128,6 +128,7 @@ static const struct xpad_device {
+       { 0x045e, 0x028e, "Microsoft X-Box 360 pad", 0, XTYPE_XBOX360 },
+       { 0x045e, 0x028f, "Microsoft X-Box 360 pad v2", 0, XTYPE_XBOX360 },
+       { 0x045e, 0x0291, "Xbox 360 Wireless Receiver (XBOX)", MAP_DPAD_TO_BUTTONS, XTYPE_XBOX360W },
++      { 0x045e, 0x02a9, "Xbox 360 Wireless Receiver (Unofficial)", MAP_DPAD_TO_BUTTONS, XTYPE_XBOX360W },
+       { 0x045e, 0x02d1, "Microsoft X-Box One pad", 0, XTYPE_XBOXONE },
+       { 0x045e, 0x02dd, "Microsoft X-Box One pad (Firmware 2015)", 0, XTYPE_XBOXONE },
+       { 0x045e, 0x02e3, "Microsoft X-Box One Elite pad", 0, XTYPE_XBOXONE },
diff --git a/queue-5.4/revert-usb-gadget-u_serial-disable-ep-before-setting-port-to-null-to-fix-the-crash-caused-by-port-being-null.patch b/queue-5.4/revert-usb-gadget-u_serial-disable-ep-before-setting-port-to-null-to-fix-the-crash-caused-by-port-being-null.patch
new file mode 100644 (file)
index 0000000..64e8f85
--- /dev/null
@@ -0,0 +1,47 @@
+From 086fd062bc3883ae1ce4166cff5355db315ad879 Mon Sep 17 00:00:00 2001
+From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Date: Fri, 17 Jan 2025 09:17:12 +0100
+Subject: Revert "usb: gadget: u_serial: Disable ep before setting port to null to fix the crash caused by port being null"
+
+From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+commit 086fd062bc3883ae1ce4166cff5355db315ad879 upstream.
+
+This reverts commit 13014969cbf07f18d62ceea40bd8ca8ec9d36cec.
+
+It is reported to cause crashes on Tegra systems, so revert it for now.
+
+Link: https://lore.kernel.org/r/1037c1ad-9230-4181-b9c3-167dbaa47644@nvidia.com
+Reported-by: Jon Hunter <jonathanh@nvidia.com>
+Cc: stable <stable@kernel.org>
+Cc: Lianqin Hu <hulianqin@vivo.com>
+Link: https://lore.kernel.org/r/2025011711-yippee-fever-a737@gregkh
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/usb/gadget/function/u_serial.c |    8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+--- a/drivers/usb/gadget/function/u_serial.c
++++ b/drivers/usb/gadget/function/u_serial.c
+@@ -1369,10 +1369,6 @@ void gserial_disconnect(struct gserial *
+       /* REVISIT as above: how best to track this? */
+       port->port_line_coding = gser->port_line_coding;
+-      /* disable endpoints, aborting down any active I/O */
+-      usb_ep_disable(gser->out);
+-      usb_ep_disable(gser->in);
+-
+       port->port_usb = NULL;
+       gser->ioport = NULL;
+       if (port->port.count > 0 || port->openclose) {
+@@ -1382,6 +1378,10 @@ void gserial_disconnect(struct gserial *
+       }
+       spin_unlock_irqrestore(&port->port_lock, flags);
++      /* disable endpoints, aborting down any active I/O */
++      usb_ep_disable(gser->out);
++      usb_ep_disable(gser->in);
++
+       /* finally, free any unused/unusable I/O buffers */
+       spin_lock_irqsave(&port->port_lock, flags);
+       if (port->port.count == 0 && !port->openclose)
index 0e35d4e66f43f28ce3e92148d7baa45e9e607a88..b034e5519ba09e9332e44529180e764ec3ca60a6 100644 (file)
@@ -84,3 +84,8 @@ net-xen-netback-prevent-uaf-in-xenvif_flush_hash.patch
 vfio-platform-check-the-bounds-of-read-write-syscalls.patch
 ext4-avoid-ext4_error-s-caused-by-enomem-in-the-truncate-path.patch
 ext4-fix-slab-use-after-free-in-ext4_split_extent_at.patch
+usb-serial-quatech2-fix-null-ptr-deref-in-qt2_process_read_urb.patch
+revert-usb-gadget-u_serial-disable-ep-before-setting-port-to-null-to-fix-the-crash-caused-by-port-being-null.patch
+input-atkbd-map-f23-key-to-support-default-copilot-shortcut.patch
+input-xpad-add-unofficial-xbox-360-wireless-receiver-clone.patch
+input-xpad-add-support-for-wooting-two-he-arm.patch
diff --git a/queue-5.4/usb-serial-quatech2-fix-null-ptr-deref-in-qt2_process_read_urb.patch b/queue-5.4/usb-serial-quatech2-fix-null-ptr-deref-in-qt2_process_read_urb.patch
new file mode 100644 (file)
index 0000000..7b47f5d
--- /dev/null
@@ -0,0 +1,53 @@
+From 575a5adf48b06a2980c9eeffedf699ed5534fade Mon Sep 17 00:00:00 2001
+From: Qasim Ijaz <qasdev00@gmail.com>
+Date: Mon, 13 Jan 2025 18:00:34 +0000
+Subject: USB: serial: quatech2: fix null-ptr-deref in qt2_process_read_urb()
+
+From: Qasim Ijaz <qasdev00@gmail.com>
+
+commit 575a5adf48b06a2980c9eeffedf699ed5534fade upstream.
+
+This patch addresses a null-ptr-deref in qt2_process_read_urb() due to
+an incorrect bounds check in the following:
+
+       if (newport > serial->num_ports) {
+               dev_err(&port->dev,
+                       "%s - port change to invalid port: %i\n",
+                       __func__, newport);
+               break;
+       }
+
+The condition doesn't account for the valid range of the serial->port
+buffer, which is from 0 to serial->num_ports - 1. When newport is equal
+to serial->num_ports, the assignment of "port" in the
+following code is out-of-bounds and NULL:
+
+       serial_priv->current_port = newport;
+       port = serial->port[serial_priv->current_port];
+
+The fix checks if newport is greater than or equal to serial->num_ports
+indicating it is out-of-bounds.
+
+Reported-by: syzbot <syzbot+506479ebf12fe435d01a@syzkaller.appspotmail.com>
+Closes: https://syzkaller.appspot.com/bug?extid=506479ebf12fe435d01a
+Fixes: f7a33e608d9a ("USB: serial: add quatech2 usb to serial driver")
+Cc: <stable@vger.kernel.org>      # 3.5
+Signed-off-by: Qasim Ijaz <qasdev00@gmail.com>
+Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Signed-off-by: Johan Hovold <johan@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/usb/serial/quatech2.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/usb/serial/quatech2.c
++++ b/drivers/usb/serial/quatech2.c
+@@ -555,7 +555,7 @@ static void qt2_process_read_urb(struct
+                               newport = *(ch + 3);
+-                              if (newport > serial->num_ports) {
++                              if (newport >= serial->num_ports) {
+                                       dev_err(&port->dev,
+                                               "%s - port change to invalid port: %i\n",
+                                               __func__, newport);