--- /dev/null
+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
+@@ -1324,6 +1324,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);
+@@ -2206,6 +2211,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;
--- /dev/null
+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 | 7 +++++--
+ 1 file changed, 5 insertions(+), 2 deletions(-)
+
+--- a/drivers/net/ethernet/atheros/alx/main.c
++++ b/drivers/net/ethernet/atheros/alx/main.c
+@@ -1902,13 +1902,16 @@ static int alx_resume(struct device *dev
+
+ if (!netif_running(alx->dev))
+ return 0;
+- netif_device_attach(alx->dev);
+
+ rtnl_lock();
+ err = __alx_open(alx, true);
+ rtnl_unlock();
++ if (err)
++ return err;
++
++ netif_device_attach(alx->dev);
+
+- return err;
++ return 0;
+ }
+
+ static SIMPLE_DEV_PM_OPS(alx_pm_ops, alx_suspend, alx_resume);
--- /dev/null
+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;
+
--- /dev/null
+From 924a9bc362a5223cd448ca08c3dde21235adc310 Mon Sep 17 00:00:00 2001
+From: Balazs Nemeth <bnemeth@redhat.com>
+Date: Tue, 9 Mar 2021 12:31:00 +0100
+Subject: net: check if protocol extracted by virtio_net_hdr_set_proto is correct
+
+From: Balazs Nemeth <bnemeth@redhat.com>
+
+commit 924a9bc362a5223cd448ca08c3dde21235adc310 upstream.
+
+For gso packets, virtio_net_hdr_set_proto sets the protocol (if it isn't
+set) based on the type in the virtio net hdr, but the skb could contain
+anything since it could come from packet_snd through a raw socket. If
+there is a mismatch between what virtio_net_hdr_set_proto sets and
+the actual protocol, then the skb could be handled incorrectly later
+on.
+
+An example where this poses an issue is with the subsequent call to
+skb_flow_dissect_flow_keys_basic which relies on skb->protocol being set
+correctly. A specially crafted packet could fool
+skb_flow_dissect_flow_keys_basic preventing EINVAL to be returned.
+
+Avoid blindly trusting the information provided by the virtio net header
+by checking that the protocol in the packet actually matches the
+protocol set by virtio_net_hdr_set_proto. Note that since the protocol
+is only checked if skb->dev implements header_ops->parse_protocol,
+packets from devices without the implementation are not checked at this
+stage.
+
+Fixes: 9274124f023b ("net: stricter validation of untrusted gso packets")
+Signed-off-by: Balazs Nemeth <bnemeth@redhat.com>
+Acked-by: Willem de Bruijn <willemb@google.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ include/linux/virtio_net.h | 7 ++++++-
+ 1 file changed, 6 insertions(+), 1 deletion(-)
+
+--- a/include/linux/virtio_net.h
++++ b/include/linux/virtio_net.h
+@@ -79,8 +79,13 @@ static inline int virtio_net_hdr_to_skb(
+ if (gso_type && skb->network_header) {
+ struct flow_keys_basic keys;
+
+- if (!skb->protocol)
++ if (!skb->protocol) {
++ __be16 protocol = dev_parse_header_protocol(skb);
++
+ virtio_net_hdr_set_proto(skb, hdr);
++ if (protocol && protocol != skb->protocol)
++ return -EINVAL;
++ }
+ retry:
+ if (!skb_flow_dissect_flow_keys_basic(skb, &keys,
+ NULL, 0, 0, 0,
--- /dev/null
+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
+@@ -359,7 +359,7 @@ struct sk_buff *udp_gro_receive(struct l
+ 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;
--- /dev/null
+From e78b2915517e8fcadb1bc130ad6aeac7099e510c Mon Sep 17 00:00:00 2001
+From: Maxim Mikityanskiy <maximmi@mellanox.com>
+Date: Thu, 21 Feb 2019 12:39:58 +0000
+Subject: net: Introduce parse_protocol header_ops callback
+
+From: Maxim Mikityanskiy <maximmi@mellanox.com>
+
+commit e78b2915517e8fcadb1bc130ad6aeac7099e510c upstream.
+
+Introduce a new optional header_ops callback called parse_protocol and a
+wrapper function dev_parse_header_protocol, similar to dev_parse_header.
+
+The new callback's purpose is to extract the protocol number from the L2
+header, the format of which is known to the driver, but not to the upper
+layers of the stack.
+
+Signed-off-by: Maxim Mikityanskiy <maximmi@mellanox.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ include/linux/netdevice.h | 10 ++++++++++
+ 1 file changed, 10 insertions(+)
+
+--- a/include/linux/netdevice.h
++++ b/include/linux/netdevice.h
+@@ -274,6 +274,7 @@ struct header_ops {
+ const struct net_device *dev,
+ const unsigned char *haddr);
+ bool (*validate)(const char *ll_header, unsigned int len);
++ __be16 (*parse_protocol)(const struct sk_buff *skb);
+ };
+
+ /* These flag bits are private to the generic network queueing
+@@ -2895,6 +2896,15 @@ static inline int dev_parse_header(const
+ return dev->header_ops->parse(skb, haddr);
+ }
+
++static inline __be16 dev_parse_header_protocol(const struct sk_buff *skb)
++{
++ const struct net_device *dev = skb->dev;
++
++ if (!dev->header_ops || !dev->header_ops->parse_protocol)
++ return 0;
++ return dev->header_ops->parse_protocol(skb);
++}
++
+ /* ll_header must have at least hard_header_len allocated */
+ static inline bool dev_validate_header(const struct net_device *dev,
+ char *ll_header, int len)
--- /dev/null
+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-introduce-parse_protocol-header_ops-callback.patch
+net-check-if-protocol-extracted-by-virtio_net_hdr_set_proto-is-correct.patch
+net-avoid-infinite-loop-in-mpls_gso_segment-when-mpls_hlen-0.patch
--- /dev/null
+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
+@@ -5,7 +5,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,