]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
5.10-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 15 Dec 2024 08:26:21 +0000 (09:26 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 15 Dec 2024 08:26:21 +0000 (09:26 +0100)
added patches:
ata-sata_highbank-fix-of-node-reference-leak-in-highbank_initialize_phys.patch
series
tcp-check-space-before-adding-mptcp-syn-options.patch
usb-dwc2-hcd-fix-getportstatus-setportfeature.patch
usb-host-max3421-hcd-correctly-abort-a-usb-request.patch

queue-5.10/ata-sata_highbank-fix-of-node-reference-leak-in-highbank_initialize_phys.patch [new file with mode: 0644]
queue-5.10/series [new file with mode: 0644]
queue-5.10/tcp-check-space-before-adding-mptcp-syn-options.patch [new file with mode: 0644]
queue-5.10/usb-dwc2-hcd-fix-getportstatus-setportfeature.patch [new file with mode: 0644]
queue-5.10/usb-host-max3421-hcd-correctly-abort-a-usb-request.patch [new file with mode: 0644]

diff --git a/queue-5.10/ata-sata_highbank-fix-of-node-reference-leak-in-highbank_initialize_phys.patch b/queue-5.10/ata-sata_highbank-fix-of-node-reference-leak-in-highbank_initialize_phys.patch
new file mode 100644 (file)
index 0000000..fc72738
--- /dev/null
@@ -0,0 +1,30 @@
+From 676fe1f6f74db988191dab5df3bf256908177072 Mon Sep 17 00:00:00 2001
+From: Joe Hattori <joe@pf.is.s.u-tokyo.ac.jp>
+Date: Thu, 5 Dec 2024 19:30:14 +0900
+Subject: ata: sata_highbank: fix OF node reference leak in highbank_initialize_phys()
+
+From: Joe Hattori <joe@pf.is.s.u-tokyo.ac.jp>
+
+commit 676fe1f6f74db988191dab5df3bf256908177072 upstream.
+
+The OF node reference obtained by of_parse_phandle_with_args() is not
+released on early return. Add a of_node_put() call before returning.
+
+Fixes: 8996b89d6bc9 ("ata: add platform driver for Calxeda AHCI controller")
+Signed-off-by: Joe Hattori <joe@pf.is.s.u-tokyo.ac.jp>
+Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/ata/sata_highbank.c |    1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/drivers/ata/sata_highbank.c
++++ b/drivers/ata/sata_highbank.c
+@@ -348,6 +348,7 @@ static int highbank_initialize_phys(stru
+                       phy_nodes[phy] = phy_data.np;
+                       cphy_base[phy] = of_iomap(phy_nodes[phy], 0);
+                       if (cphy_base[phy] == NULL) {
++                              of_node_put(phy_data.np);
+                               return 0;
+                       }
+                       phy_count += 1;
diff --git a/queue-5.10/series b/queue-5.10/series
new file mode 100644 (file)
index 0000000..25ccc68
--- /dev/null
@@ -0,0 +1,4 @@
+tcp-check-space-before-adding-mptcp-syn-options.patch
+usb-host-max3421-hcd-correctly-abort-a-usb-request.patch
+ata-sata_highbank-fix-of-node-reference-leak-in-highbank_initialize_phys.patch
+usb-dwc2-hcd-fix-getportstatus-setportfeature.patch
diff --git a/queue-5.10/tcp-check-space-before-adding-mptcp-syn-options.patch b/queue-5.10/tcp-check-space-before-adding-mptcp-syn-options.patch
new file mode 100644 (file)
index 0000000..52e9d9c
--- /dev/null
@@ -0,0 +1,44 @@
+From 06d64ab46f19ac12f59a1d2aa8cd196b2e4edb5b Mon Sep 17 00:00:00 2001
+From: MoYuanhao <moyuanhao3676@163.com>
+Date: Mon, 9 Dec 2024 13:28:14 +0100
+Subject: tcp: check space before adding MPTCP SYN options
+
+From: MoYuanhao <moyuanhao3676@163.com>
+
+commit 06d64ab46f19ac12f59a1d2aa8cd196b2e4edb5b upstream.
+
+Ensure there is enough space before adding MPTCP options in
+tcp_syn_options().
+
+Without this check, 'remaining' could underflow, and causes issues. If
+there is not enough space, MPTCP should not be used.
+
+Signed-off-by: MoYuanhao <moyuanhao3676@163.com>
+Fixes: cec37a6e41aa ("mptcp: Handle MP_CAPABLE options for outgoing connections")
+Cc: stable@vger.kernel.org
+Acked-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
+[ Matt: Add Fixes, cc Stable, update Description ]
+Signed-off-by: Matthieu Baerts (NGI0) <matttbe@kernel.org>
+Reviewed-by: Eric Dumazet <edumazet@google.com>
+Link: https://patch.msgid.link/20241209-net-mptcp-check-space-syn-v1-1-2da992bb6f74@kernel.org
+Signed-off-by: Jakub Kicinski <kuba@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ net/ipv4/tcp_output.c |    6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+--- a/net/ipv4/tcp_output.c
++++ b/net/ipv4/tcp_output.c
+@@ -823,8 +823,10 @@ static unsigned int tcp_syn_options(stru
+               unsigned int size;
+               if (mptcp_syn_options(sk, skb, &size, &opts->mptcp)) {
+-                      opts->options |= OPTION_MPTCP;
+-                      remaining -= size;
++                      if (remaining >= size) {
++                              opts->options |= OPTION_MPTCP;
++                              remaining -= size;
++                      }
+               }
+       }
diff --git a/queue-5.10/usb-dwc2-hcd-fix-getportstatus-setportfeature.patch b/queue-5.10/usb-dwc2-hcd-fix-getportstatus-setportfeature.patch
new file mode 100644 (file)
index 0000000..55dac54
--- /dev/null
@@ -0,0 +1,66 @@
+From a8d3e4a734599c7d0f6735f8db8a812e503395dd Mon Sep 17 00:00:00 2001
+From: Stefan Wahren <wahrenst@gmx.net>
+Date: Mon, 2 Dec 2024 01:16:30 +0100
+Subject: usb: dwc2: hcd: Fix GetPortStatus & SetPortFeature
+
+From: Stefan Wahren <wahrenst@gmx.net>
+
+commit a8d3e4a734599c7d0f6735f8db8a812e503395dd upstream.
+
+On Rasperry Pis without onboard USB hub the power cycle during
+power connect init only disable the port but never enabled it again:
+
+  usb usb1-port1: attempt power cycle
+
+The port relevant part in dwc2_hcd_hub_control() is skipped in case
+port_connect_status = 0 under the assumption the core is or will be soon
+in device mode. But this assumption is wrong, because after ClearPortFeature
+USB_PORT_FEAT_POWER the port_connect_status will also be 0 and
+SetPortFeature (incl. USB_PORT_FEAT_POWER) will be a no-op.
+
+Fix the behavior of dwc2_hcd_hub_control() by replacing the
+port_connect_status check with dwc2_is_device_mode().
+
+Link: https://github.com/raspberrypi/linux/issues/6247
+Fixes: 7359d482eb4d ("staging: HCD files for the DWC2 driver")
+Signed-off-by: Stefan Wahren <wahrenst@gmx.net>
+Link: https://lore.kernel.org/r/20241202001631.75473-3-wahrenst@gmx.net
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/usb/dwc2/hcd.c |   16 ++++++----------
+ 1 file changed, 6 insertions(+), 10 deletions(-)
+
+--- a/drivers/usb/dwc2/hcd.c
++++ b/drivers/usb/dwc2/hcd.c
+@@ -3544,11 +3544,9 @@ static int dwc2_hcd_hub_control(struct d
+                       port_status |= USB_PORT_STAT_C_OVERCURRENT << 16;
+               }
+-              if (!hsotg->flags.b.port_connect_status) {
++              if (dwc2_is_device_mode(hsotg)) {
+                       /*
+-                       * The port is disconnected, which means the core is
+-                       * either in device mode or it soon will be. Just
+-                       * return 0's for the remainder of the port status
++                       * Just return 0's for the remainder of the port status
+                        * since the port register can't be read if the core
+                        * is in device mode.
+                        */
+@@ -3618,13 +3616,11 @@ static int dwc2_hcd_hub_control(struct d
+               if (wvalue != USB_PORT_FEAT_TEST && (!windex || windex > 1))
+                       goto error;
+-              if (!hsotg->flags.b.port_connect_status) {
++              if (dwc2_is_device_mode(hsotg)) {
+                       /*
+-                       * The port is disconnected, which means the core is
+-                       * either in device mode or it soon will be. Just
+-                       * return without doing anything since the port
+-                       * register can't be written if the core is in device
+-                       * mode.
++                       * Just return 0's for the remainder of the port status
++                       * since the port register can't be read if the core
++                       * is in device mode.
+                        */
+                       break;
+               }
diff --git a/queue-5.10/usb-host-max3421-hcd-correctly-abort-a-usb-request.patch b/queue-5.10/usb-host-max3421-hcd-correctly-abort-a-usb-request.patch
new file mode 100644 (file)
index 0000000..95f65be
--- /dev/null
@@ -0,0 +1,50 @@
+From 0d2ada05227881f3d0722ca2364e3f7a860a301f Mon Sep 17 00:00:00 2001
+From: Mark Tomlinson <mark.tomlinson@alliedtelesis.co.nz>
+Date: Mon, 25 Nov 2024 11:14:30 +1300
+Subject: usb: host: max3421-hcd: Correctly abort a USB request.
+
+From: Mark Tomlinson <mark.tomlinson@alliedtelesis.co.nz>
+
+commit 0d2ada05227881f3d0722ca2364e3f7a860a301f upstream.
+
+If the current USB request was aborted, the spi thread would not respond
+to any further requests. This is because the "curr_urb" pointer would
+not become NULL, so no further requests would be taken off the queue.
+The solution here is to set the "urb_done" flag, as this will cause the
+correct handling of the URB. Also clear interrupts that should only be
+expected if an URB is in progress.
+
+Fixes: 2d53139f3162 ("Add support for using a MAX3421E chip as a host driver.")
+Cc: stable <stable@kernel.org>
+Signed-off-by: Mark Tomlinson <mark.tomlinson@alliedtelesis.co.nz>
+Link: https://lore.kernel.org/r/20241124221430.1106080-1-mark.tomlinson@alliedtelesis.co.nz
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/usb/host/max3421-hcd.c |   16 +++++++++++-----
+ 1 file changed, 11 insertions(+), 5 deletions(-)
+
+--- a/drivers/usb/host/max3421-hcd.c
++++ b/drivers/usb/host/max3421-hcd.c
+@@ -785,11 +785,17 @@ max3421_check_unlink(struct usb_hcd *hcd
+                               retval = 1;
+                               dev_dbg(&spi->dev, "%s: URB %p unlinked=%d",
+                                       __func__, urb, urb->unlinked);
+-                              usb_hcd_unlink_urb_from_ep(hcd, urb);
+-                              spin_unlock_irqrestore(&max3421_hcd->lock,
+-                                                     flags);
+-                              usb_hcd_giveback_urb(hcd, urb, 0);
+-                              spin_lock_irqsave(&max3421_hcd->lock, flags);
++                              if (urb == max3421_hcd->curr_urb) {
++                                      max3421_hcd->urb_done = 1;
++                                      max3421_hcd->hien &= ~(BIT(MAX3421_HI_HXFRDN_BIT) |
++                                                             BIT(MAX3421_HI_RCVDAV_BIT));
++                              } else {
++                                      usb_hcd_unlink_urb_from_ep(hcd, urb);
++                                      spin_unlock_irqrestore(&max3421_hcd->lock,
++                                                             flags);
++                                      usb_hcd_giveback_urb(hcd, urb, 0);
++                                      spin_lock_irqsave(&max3421_hcd->lock, flags);
++                              }
+                       }
+               }
+       }