]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.9-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 11 Mar 2021 17:52:54 +0000 (18:52 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 11 Mar 2021 17:52:54 +0000 (18:52 +0100)
added patches:
ath9k-fix-transmitting-to-stations-in-dynamic-smps-mode.patch
ethernet-alx-fix-order-of-calls-on-resume.patch
net-avoid-infinite-loop-in-mpls_gso_segment-when-mpls_hlen-0.patch
net-fix-gro-aggregation-for-udp-encaps-with-zero-csum.patch
uapi-nfnetlink_cthelper.h-fix-userspace-compilation-error.patch

queue-4.9/ath9k-fix-transmitting-to-stations-in-dynamic-smps-mode.patch [new file with mode: 0644]
queue-4.9/ethernet-alx-fix-order-of-calls-on-resume.patch [new file with mode: 0644]
queue-4.9/net-avoid-infinite-loop-in-mpls_gso_segment-when-mpls_hlen-0.patch [new file with mode: 0644]
queue-4.9/net-fix-gro-aggregation-for-udp-encaps-with-zero-csum.patch [new file with mode: 0644]
queue-4.9/series [new file with mode: 0644]
queue-4.9/uapi-nfnetlink_cthelper.h-fix-userspace-compilation-error.patch [new file with mode: 0644]

diff --git a/queue-4.9/ath9k-fix-transmitting-to-stations-in-dynamic-smps-mode.patch b/queue-4.9/ath9k-fix-transmitting-to-stations-in-dynamic-smps-mode.patch
new file mode 100644 (file)
index 0000000..1921c4a
--- /dev/null
@@ -0,0 +1,60 @@
+From 3b9ea7206d7e1fdd7419cbd10badd3b2c80d04b4 Mon Sep 17 00:00:00 2001
+From: Felix Fietkau <nbd@nbd.name>
+Date: Sun, 14 Feb 2021 19:49:11 +0100
+Subject: ath9k: fix transmitting to stations in dynamic SMPS mode
+
+From: Felix Fietkau <nbd@nbd.name>
+
+commit 3b9ea7206d7e1fdd7419cbd10badd3b2c80d04b4 upstream.
+
+When transmitting to a receiver in dynamic SMPS mode, all transmissions that
+use multiple spatial streams need to be sent using CTS-to-self or RTS/CTS to
+give the receiver's extra chains some time to wake up.
+This fixes the tx rate getting stuck at <= MCS7 for some clients, especially
+Intel ones, which make aggressive use of SMPS.
+
+Cc: stable@vger.kernel.org
+Reported-by: Martin Kennedy <hurricos@gmail.com>
+Signed-off-by: Felix Fietkau <nbd@nbd.name>
+Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
+Link: https://lore.kernel.org/r/20210214184911.96702-1-nbd@nbd.name
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/net/wireless/ath/ath9k/ath9k.h |    3 ++-
+ drivers/net/wireless/ath/ath9k/xmit.c  |    6 ++++++
+ 2 files changed, 8 insertions(+), 1 deletion(-)
+
+--- a/drivers/net/wireless/ath/ath9k/ath9k.h
++++ b/drivers/net/wireless/ath/ath9k/ath9k.h
+@@ -179,7 +179,8 @@ struct ath_frame_info {
+       s8 txq;
+       u8 keyix;
+       u8 rtscts_rate;
+-      u8 retries : 7;
++      u8 retries : 6;
++      u8 dyn_smps : 1;
+       u8 baw_tracked : 1;
+       u8 tx_power;
+       enum ath9k_key_type keytype:2;
+--- a/drivers/net/wireless/ath/ath9k/xmit.c
++++ b/drivers/net/wireless/ath/ath9k/xmit.c
+@@ -1255,6 +1255,11 @@ static void ath_buf_set_rate(struct ath_
+                                is_40, is_sgi, is_sp);
+                       if (rix < 8 && (tx_info->flags & IEEE80211_TX_CTL_STBC))
+                               info->rates[i].RateFlags |= ATH9K_RATESERIES_STBC;
++                      if (rix >= 8 && fi->dyn_smps) {
++                              info->rates[i].RateFlags |=
++                                      ATH9K_RATESERIES_RTS_CTS;
++                              info->flags |= ATH9K_TXDESC_CTSENA;
++                      }
+                       info->txpower[i] = ath_get_rate_txpower(sc, bf, rix,
+                                                               is_40, false);
+@@ -2158,6 +2163,7 @@ static void setup_frame_info(struct ieee
+               fi->keyix = an->ps_key;
+       else
+               fi->keyix = ATH9K_TXKEYIX_INVALID;
++      fi->dyn_smps = sta && sta->smps_mode == IEEE80211_SMPS_DYNAMIC;
+       fi->keytype = keytype;
+       fi->framelen = framelen;
+       fi->tx_power = txpower;
diff --git a/queue-4.9/ethernet-alx-fix-order-of-calls-on-resume.patch b/queue-4.9/ethernet-alx-fix-order-of-calls-on-resume.patch
new file mode 100644 (file)
index 0000000..2016d64
--- /dev/null
@@ -0,0 +1,70 @@
+From a4dcfbc4ee2218abd567d81d795082d8d4afcdf6 Mon Sep 17 00:00:00 2001
+From: Jakub Kicinski <kuba@kernel.org>
+Date: Fri, 5 Mar 2021 14:17:29 -0800
+Subject: ethernet: alx: fix order of calls on resume
+
+From: Jakub Kicinski <kuba@kernel.org>
+
+commit a4dcfbc4ee2218abd567d81d795082d8d4afcdf6 upstream.
+
+netif_device_attach() will unpause the queues so we can't call
+it before __alx_open(). This went undetected until
+commit b0999223f224 ("alx: add ability to allocate and free
+alx_napi structures") but now if stack tries to xmit immediately
+on resume before __alx_open() we'll crash on the NAPI being null:
+
+ BUG: kernel NULL pointer dereference, address: 0000000000000198
+ CPU: 0 PID: 12 Comm: ksoftirqd/0 Tainted: G           OE 5.10.0-3-amd64 #1 Debian 5.10.13-1
+ Hardware name: Gigabyte Technology Co., Ltd. To be filled by O.E.M./H77-D3H, BIOS F15 11/14/2013
+ RIP: 0010:alx_start_xmit+0x34/0x650 [alx]
+ Code: 41 56 41 55 41 54 55 53 48 83 ec 20 0f b7 57 7c 8b 8e b0
+0b 00 00 39 ca 72 06 89 d0 31 d2 f7 f1 89 d2 48 8b 84 df
+ RSP: 0018:ffffb09240083d28 EFLAGS: 00010297
+ RAX: 0000000000000000 RBX: ffffa04d80ae7800 RCX: 0000000000000004
+ RDX: 0000000000000000 RSI: ffffa04d80afa000 RDI: ffffa04e92e92a00
+ RBP: 0000000000000042 R08: 0000000000000100 R09: ffffa04ea3146700
+ R10: 0000000000000014 R11: 0000000000000000 R12: ffffa04e92e92100
+ R13: 0000000000000001 R14: ffffa04e92e92a00 R15: ffffa04e92e92a00
+ FS:  0000000000000000(0000) GS:ffffa0508f600000(0000) knlGS:0000000000000000
+ i915 0000:00:02.0: vblank wait timed out on crtc 0
+ CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
+ CR2: 0000000000000198 CR3: 000000004460a001 CR4: 00000000001706f0
+ Call Trace:
+  dev_hard_start_xmit+0xc7/0x1e0
+  sch_direct_xmit+0x10f/0x310
+
+Cc: <stable@vger.kernel.org> # 4.9+
+Fixes: bc2bebe8de8e ("alx: remove WoL support")
+Reported-by: Zbynek Michl <zbynek.michl@gmail.com>
+Link: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=983595
+Signed-off-by: Jakub Kicinski <kuba@kernel.org>
+Tested-by: Zbynek Michl <zbynek.michl@gmail.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/net/ethernet/atheros/alx/main.c |    8 +++++++-
+ 1 file changed, 7 insertions(+), 1 deletion(-)
+
+--- a/drivers/net/ethernet/atheros/alx/main.c
++++ b/drivers/net/ethernet/atheros/alx/main.c
+@@ -1694,13 +1694,19 @@ static int alx_resume(struct device *dev
+       struct pci_dev *pdev = to_pci_dev(dev);
+       struct alx_priv *alx = pci_get_drvdata(pdev);
+       struct alx_hw *hw = &alx->hw;
++      int err;
+       alx_reset_phy(hw);
+       if (!netif_running(alx->dev))
+               return 0;
++
++      err = __alx_open(alx, true);
++      if (err)
++              return err;
++
+       netif_device_attach(alx->dev);
+-      return __alx_open(alx, true);
++      return 0;
+ }
+ static SIMPLE_DEV_PM_OPS(alx_pm_ops, alx_suspend, alx_resume);
diff --git a/queue-4.9/net-avoid-infinite-loop-in-mpls_gso_segment-when-mpls_hlen-0.patch b/queue-4.9/net-avoid-infinite-loop-in-mpls_gso_segment-when-mpls_hlen-0.patch
new file mode 100644 (file)
index 0000000..3d1d102
--- /dev/null
@@ -0,0 +1,44 @@
+From d348ede32e99d3a04863e9f9b28d224456118c27 Mon Sep 17 00:00:00 2001
+From: Balazs Nemeth <bnemeth@redhat.com>
+Date: Tue, 9 Mar 2021 12:31:01 +0100
+Subject: net: avoid infinite loop in mpls_gso_segment when mpls_hlen == 0
+
+From: Balazs Nemeth <bnemeth@redhat.com>
+
+commit d348ede32e99d3a04863e9f9b28d224456118c27 upstream.
+
+A packet with skb_inner_network_header(skb) == skb_network_header(skb)
+and ETH_P_MPLS_UC will prevent mpls_gso_segment from pulling any headers
+from the packet. Subsequently, the call to skb_mac_gso_segment will
+again call mpls_gso_segment with the same packet leading to an infinite
+loop. In addition, ensure that the header length is a multiple of four,
+which should hold irrespective of the number of stacked labels.
+
+Signed-off-by: Balazs Nemeth <bnemeth@redhat.com>
+Acked-by: Willem de Bruijn <willemb@google.com>
+Reviewed-by: David Ahern <dsahern@kernel.org>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ net/mpls/mpls_gso.c |    3 +++
+ 1 file changed, 3 insertions(+)
+
+--- a/net/mpls/mpls_gso.c
++++ b/net/mpls/mpls_gso.c
+@@ -18,6 +18,7 @@
+ #include <linux/netdev_features.h>
+ #include <linux/netdevice.h>
+ #include <linux/skbuff.h>
++#include <net/mpls.h>
+ static struct sk_buff *mpls_gso_segment(struct sk_buff *skb,
+                                      netdev_features_t features)
+@@ -31,6 +32,8 @@ static struct sk_buff *mpls_gso_segment(
+       skb_reset_network_header(skb);
+       mpls_hlen = skb_inner_network_header(skb) - skb_network_header(skb);
++      if (unlikely(!mpls_hlen || mpls_hlen % MPLS_HLEN))
++              goto out;
+       if (unlikely(!pskb_may_pull(skb, mpls_hlen)))
+               goto out;
diff --git a/queue-4.9/net-fix-gro-aggregation-for-udp-encaps-with-zero-csum.patch b/queue-4.9/net-fix-gro-aggregation-for-udp-encaps-with-zero-csum.patch
new file mode 100644 (file)
index 0000000..7180d28
--- /dev/null
@@ -0,0 +1,110 @@
+From 89e5c58fc1e2857ccdaae506fb8bc5fed57ee063 Mon Sep 17 00:00:00 2001
+From: Daniel Borkmann <daniel@iogearbox.net>
+Date: Fri, 26 Feb 2021 22:22:48 +0100
+Subject: net: Fix gro aggregation for udp encaps with zero csum
+
+From: Daniel Borkmann <daniel@iogearbox.net>
+
+commit 89e5c58fc1e2857ccdaae506fb8bc5fed57ee063 upstream.
+
+We noticed a GRO issue for UDP-based encaps such as vxlan/geneve when the
+csum for the UDP header itself is 0. In that case, GRO aggregation does
+not take place on the phys dev, but instead is deferred to the vxlan/geneve
+driver (see trace below).
+
+The reason is essentially that GRO aggregation bails out in udp_gro_receive()
+for such case when drivers marked the skb with CHECKSUM_UNNECESSARY (ice, i40e,
+others) where for non-zero csums 2abb7cdc0dc8 ("udp: Add support for doing
+checksum unnecessary conversion") promotes those skbs to CHECKSUM_COMPLETE
+and napi context has csum_valid set. This is however not the case for zero
+UDP csum (here: csum_cnt is still 0 and csum_valid continues to be false).
+
+At the same time 57c67ff4bd92 ("udp: additional GRO support") added matches
+on !uh->check ^ !uh2->check as part to determine candidates for aggregation,
+so it certainly is expected to handle zero csums in udp_gro_receive(). The
+purpose of the check added via 662880f44203 ("net: Allow GRO to use and set
+levels of checksum unnecessary") seems to catch bad csum and stop aggregation
+right away.
+
+One way to fix aggregation in the zero case is to only perform the !csum_valid
+check in udp_gro_receive() if uh->check is infact non-zero.
+
+Before:
+
+  [...]
+  swapper     0 [008]   731.946506: net:netif_receive_skb: dev=enp10s0f0  skbaddr=0xffff966497100400 len=1500   (1)
+  swapper     0 [008]   731.946507: net:netif_receive_skb: dev=enp10s0f0  skbaddr=0xffff966497100200 len=1500
+  swapper     0 [008]   731.946507: net:netif_receive_skb: dev=enp10s0f0  skbaddr=0xffff966497101100 len=1500
+  swapper     0 [008]   731.946508: net:netif_receive_skb: dev=enp10s0f0  skbaddr=0xffff966497101700 len=1500
+  swapper     0 [008]   731.946508: net:netif_receive_skb: dev=enp10s0f0  skbaddr=0xffff966497101b00 len=1500
+  swapper     0 [008]   731.946508: net:netif_receive_skb: dev=enp10s0f0  skbaddr=0xffff966497100600 len=1500
+  swapper     0 [008]   731.946508: net:netif_receive_skb: dev=enp10s0f0  skbaddr=0xffff966497100f00 len=1500
+  swapper     0 [008]   731.946509: net:netif_receive_skb: dev=enp10s0f0  skbaddr=0xffff966497100a00 len=1500
+  swapper     0 [008]   731.946516: net:netif_receive_skb: dev=enp10s0f0  skbaddr=0xffff966497100500 len=1500
+  swapper     0 [008]   731.946516: net:netif_receive_skb: dev=enp10s0f0  skbaddr=0xffff966497100700 len=1500
+  swapper     0 [008]   731.946516: net:netif_receive_skb: dev=enp10s0f0  skbaddr=0xffff966497101d00 len=1500   (2)
+  swapper     0 [008]   731.946517: net:netif_receive_skb: dev=enp10s0f0  skbaddr=0xffff966497101000 len=1500
+  swapper     0 [008]   731.946517: net:netif_receive_skb: dev=enp10s0f0  skbaddr=0xffff966497101c00 len=1500
+  swapper     0 [008]   731.946517: net:netif_receive_skb: dev=enp10s0f0  skbaddr=0xffff966497101400 len=1500
+  swapper     0 [008]   731.946518: net:netif_receive_skb: dev=enp10s0f0  skbaddr=0xffff966497100e00 len=1500
+  swapper     0 [008]   731.946518: net:netif_receive_skb: dev=enp10s0f0  skbaddr=0xffff966497101600 len=1500
+  swapper     0 [008]   731.946521: net:netif_receive_skb: dev=enp10s0f0  skbaddr=0xffff966497100800 len=774
+  swapper     0 [008]   731.946530: net:netif_receive_skb: dev=test_vxlan skbaddr=0xffff966497100400 len=14032 (1)
+  swapper     0 [008]   731.946530: net:netif_receive_skb: dev=test_vxlan skbaddr=0xffff966497101d00 len=9112  (2)
+  [...]
+
+  # netperf -H 10.55.10.4 -t TCP_STREAM -l 20
+  MIGRATED TCP STREAM TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET to 10.55.10.4 () port 0 AF_INET : demo
+  Recv   Send    Send
+  Socket Socket  Message  Elapsed
+  Size   Size    Size     Time     Throughput
+  bytes  bytes   bytes    secs.    10^6bits/sec
+
+   87380  16384  16384    20.01    13129.24
+
+After:
+
+  [...]
+  swapper     0 [026]   521.862641: net:netif_receive_skb: dev=enp10s0f0  skbaddr=0xffff93ab0d479000 len=11286 (1)
+  swapper     0 [026]   521.862643: net:netif_receive_skb: dev=test_vxlan skbaddr=0xffff93ab0d479000 len=11236 (1)
+  swapper     0 [026]   521.862650: net:netif_receive_skb: dev=enp10s0f0  skbaddr=0xffff93ab0d478500 len=2898  (2)
+  swapper     0 [026]   521.862650: net:netif_receive_skb: dev=enp10s0f0  skbaddr=0xffff93ab0d479f00 len=8490  (3)
+  swapper     0 [026]   521.862653: net:netif_receive_skb: dev=test_vxlan skbaddr=0xffff93ab0d478500 len=2848  (2)
+  swapper     0 [026]   521.862653: net:netif_receive_skb: dev=test_vxlan skbaddr=0xffff93ab0d479f00 len=8440  (3)
+  [...]
+
+  # netperf -H 10.55.10.4 -t TCP_STREAM -l 20
+  MIGRATED TCP STREAM TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET to 10.55.10.4 () port 0 AF_INET : demo
+  Recv   Send    Send
+  Socket Socket  Message  Elapsed
+  Size   Size    Size     Time     Throughput
+  bytes  bytes   bytes    secs.    10^6bits/sec
+
+   87380  16384  16384    20.01    24576.53
+
+Fixes: 57c67ff4bd92 ("udp: additional GRO support")
+Fixes: 662880f44203 ("net: Allow GRO to use and set levels of checksum unnecessary")
+Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
+Cc: Eric Dumazet <edumazet@google.com>
+Cc: Jesse Brandeburg <jesse.brandeburg@intel.com>
+Cc: Tom Herbert <tom@herbertland.com>
+Acked-by: Willem de Bruijn <willemb@google.com>
+Acked-by: John Fastabend <john.fastabend@gmail.com>
+Link: https://lore.kernel.org/r/20210226212248.8300-1-daniel@iogearbox.net
+Signed-off-by: Jakub Kicinski <kuba@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ net/ipv4/udp_offload.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/net/ipv4/udp_offload.c
++++ b/net/ipv4/udp_offload.c
+@@ -265,7 +265,7 @@ struct sk_buff **udp_gro_receive(struct
+       struct sock *sk;
+       if (NAPI_GRO_CB(skb)->encap_mark ||
+-          (skb->ip_summed != CHECKSUM_PARTIAL &&
++          (uh->check && skb->ip_summed != CHECKSUM_PARTIAL &&
+            NAPI_GRO_CB(skb)->csum_cnt == 0 &&
+            !NAPI_GRO_CB(skb)->csum_valid))
+               goto out;
diff --git a/queue-4.9/series b/queue-4.9/series
new file mode 100644 (file)
index 0000000..38c2d09
--- /dev/null
@@ -0,0 +1,5 @@
+uapi-nfnetlink_cthelper.h-fix-userspace-compilation-error.patch
+ethernet-alx-fix-order-of-calls-on-resume.patch
+ath9k-fix-transmitting-to-stations-in-dynamic-smps-mode.patch
+net-fix-gro-aggregation-for-udp-encaps-with-zero-csum.patch
+net-avoid-infinite-loop-in-mpls_gso_segment-when-mpls_hlen-0.patch
diff --git a/queue-4.9/uapi-nfnetlink_cthelper.h-fix-userspace-compilation-error.patch b/queue-4.9/uapi-nfnetlink_cthelper.h-fix-userspace-compilation-error.patch
new file mode 100644 (file)
index 0000000..85c5fff
--- /dev/null
@@ -0,0 +1,33 @@
+From c33cb0020ee6dd96cc9976d6085a7d8422f6dbed Mon Sep 17 00:00:00 2001
+From: "Dmitry V. Levin" <ldv@altlinux.org>
+Date: Mon, 22 Feb 2021 08:00:00 +0000
+Subject: uapi: nfnetlink_cthelper.h: fix userspace compilation error
+
+From: Dmitry V. Levin <ldv@altlinux.org>
+
+commit c33cb0020ee6dd96cc9976d6085a7d8422f6dbed upstream.
+
+Apparently, <linux/netfilter/nfnetlink_cthelper.h> and
+<linux/netfilter/nfnetlink_acct.h> could not be included into the same
+compilation unit because of a cut-and-paste typo in the former header.
+
+Fixes: 12f7a505331e6 ("netfilter: add user-space connection tracking helper infrastructure")
+Cc: <stable@vger.kernel.org> # v3.6
+Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
+Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ include/uapi/linux/netfilter/nfnetlink_cthelper.h |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/include/uapi/linux/netfilter/nfnetlink_cthelper.h
++++ b/include/uapi/linux/netfilter/nfnetlink_cthelper.h
+@@ -4,7 +4,7 @@
+ #define NFCT_HELPER_STATUS_DISABLED   0
+ #define NFCT_HELPER_STATUS_ENABLED    1
+-enum nfnl_acct_msg_types {
++enum nfnl_cthelper_msg_types {
+       NFNL_MSG_CTHELPER_NEW,
+       NFNL_MSG_CTHELPER_GET,
+       NFNL_MSG_CTHELPER_DEL,