]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.9-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 24 Jan 2022 13:02:37 +0000 (14:02 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 24 Jan 2022 13:02:37 +0000 (14:02 +0100)
added patches:
net-axienet-fix-number-of-tx-ring-slots-for-available-check.patch

queue-4.9/net-axienet-fix-number-of-tx-ring-slots-for-available-check.patch [new file with mode: 0644]
queue-4.9/series

diff --git a/queue-4.9/net-axienet-fix-number-of-tx-ring-slots-for-available-check.patch b/queue-4.9/net-axienet-fix-number-of-tx-ring-slots-for-available-check.patch
new file mode 100644 (file)
index 0000000..3b09856
--- /dev/null
@@ -0,0 +1,41 @@
+From aba57a823d2985a2cc8c74a2535f3a88e68d9424 Mon Sep 17 00:00:00 2001
+From: Robert Hancock <robert.hancock@calian.com>
+Date: Tue, 18 Jan 2022 15:41:30 -0600
+Subject: net: axienet: fix number of TX ring slots for available check
+
+From: Robert Hancock <robert.hancock@calian.com>
+
+commit aba57a823d2985a2cc8c74a2535f3a88e68d9424 upstream.
+
+The check for the number of available TX ring slots was off by 1 since a
+slot is required for the skb header as well as each fragment. This could
+result in overwriting a TX ring slot that was still in use.
+
+Fixes: 8a3b7a252dca9 ("drivers/net/ethernet/xilinx: added Xilinx AXI Ethernet driver")
+Signed-off-by: Robert Hancock <robert.hancock@calian.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/net/ethernet/xilinx/xilinx_axienet_main.c |    4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
++++ b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
+@@ -680,7 +680,7 @@ axienet_start_xmit(struct sk_buff *skb,
+       num_frag = skb_shinfo(skb)->nr_frags;
+       cur_p = &lp->tx_bd_v[lp->tx_bd_tail];
+-      if (axienet_check_tx_bd_space(lp, num_frag)) {
++      if (axienet_check_tx_bd_space(lp, num_frag + 1)) {
+               if (netif_queue_stopped(ndev))
+                       return NETDEV_TX_BUSY;
+@@ -690,7 +690,7 @@ axienet_start_xmit(struct sk_buff *skb,
+               smp_mb();
+               /* Space might have just been freed - check again */
+-              if (axienet_check_tx_bd_space(lp, num_frag))
++              if (axienet_check_tx_bd_space(lp, num_frag + 1))
+                       return NETDEV_TX_BUSY;
+               netif_wake_queue(ndev);
index 50b7172e329eda9ae2b7455842cdbbe8d4f35c9f..5be3535eb4520e8e4ad2bfafebf6d1dcb74548ea 100644 (file)
@@ -132,3 +132,4 @@ net-fsl-xgmac_mdio-fix-incorrect-iounmap-when-removing-module.patch
 parisc-pdc_stable-fix-memory-leak-in-pdcs_register_pathentries.patch
 af_unix-annote-lockless-accesses-to-unix_tot_inflight-gc_in_progress.patch
 net-axienet-wait-for-phyrstcmplt-after-core-reset.patch
+net-axienet-fix-number-of-tx-ring-slots-for-available-check.patch