]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
Fixes for 5.10
authorSasha Levin <sashal@kernel.org>
Fri, 1 Nov 2024 19:19:36 +0000 (15:19 -0400)
committerSasha Levin <sashal@kernel.org>
Fri, 1 Nov 2024 19:19:36 +0000 (15:19 -0400)
Signed-off-by: Sasha Levin <sashal@kernel.org>
21 files changed:
queue-5.10/asoc-cs42l51-fix-some-error-handling-paths-in-cs42l5.patch [new file with mode: 0644]
queue-5.10/bpf-fix-out-of-bounds-write-in-trie_get_next_key.patch [new file with mode: 0644]
queue-5.10/gtp-allow-1-to-be-specified-as-file-description-from.patch [new file with mode: 0644]
queue-5.10/igb-disable-threaded-irq-for-igb_msix_other.patch [new file with mode: 0644]
queue-5.10/ipv4-ip_tunnel-fix-suspicious-rcu-usage-warning-in-i.patch [new file with mode: 0644]
queue-5.10/mac80211-add-support-to-trigger-sta-disconnect-on-ha.patch [new file with mode: 0644]
queue-5.10/mac80211-do-drv_reconfig_complete-before-restarting-.patch [new file with mode: 0644]
queue-5.10/mac80211-mac80211_message_tracing-should-depend-on-t.patch [new file with mode: 0644]
queue-5.10/net-hns3-initialize-reset_timer-before-hclgevf_misc_.patch [new file with mode: 0644]
queue-5.10/net-sched-stop-qdisc_tree_reduce_backlog-on-tc_h_roo.patch [new file with mode: 0644]
queue-5.10/net-skip-offload-for-netif_f_ipv6_csum-if-ipv6-heade.patch [new file with mode: 0644]
queue-5.10/net-support-ip-generic-csum-processing-in-skb_csum_h.patch [new file with mode: 0644]
queue-5.10/netfilter-nft_payload-sanitize-offset-and-length-bef.patch [new file with mode: 0644]
queue-5.10/rdma-bnxt_re-synchronize-the-qp-handle-table-array.patch [new file with mode: 0644]
queue-5.10/rdma-cxgb4-dump-vendor-specific-qp-details.patch [new file with mode: 0644]
queue-5.10/rdma-mlx5-round-max_rd_atomic-max_dest_rd_atomic-up-.patch [new file with mode: 0644]
queue-5.10/series
queue-5.10/wifi-brcm80211-brcm_tracing-should-depend-on-tracing.patch [new file with mode: 0644]
queue-5.10/wifi-iwlwifi-mvm-disconnect-station-vifs-if-recovery.patch [new file with mode: 0644]
queue-5.10/wifi-iwlwifi-mvm-fix-response-handling-in-iwl_mvm_se.patch [new file with mode: 0644]
queue-5.10/wifi-mac80211-skip-non-uploaded-keys-in-ieee80211_it.patch [new file with mode: 0644]

diff --git a/queue-5.10/asoc-cs42l51-fix-some-error-handling-paths-in-cs42l5.patch b/queue-5.10/asoc-cs42l51-fix-some-error-handling-paths-in-cs42l5.patch
new file mode 100644 (file)
index 0000000..4faca21
--- /dev/null
@@ -0,0 +1,56 @@
+From 77a28d17ec48e48daa0471c2f6628d2da9478e6f Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Sat, 26 Oct 2024 22:46:34 +0200
+Subject: ASoC: cs42l51: Fix some error handling paths in cs42l51_probe()
+
+From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
+
+[ Upstream commit d221b844ee79823ffc29b7badc4010bdb0960224 ]
+
+If devm_gpiod_get_optional() fails, we need to disable previously enabled
+regulators, as done in the other error handling path of the function.
+
+Also, gpiod_set_value_cansleep(, 1) needs to be called to undo a
+potential gpiod_set_value_cansleep(, 0).
+If the "reset" gpio is not defined, this additional call is just a no-op.
+
+This behavior is the same as the one already in the .remove() function.
+
+Fixes: 11b9cd748e31 ("ASoC: cs42l51: add reset management")
+Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
+Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
+Link: https://patch.msgid.link/a5e5f4b9fb03f46abd2c93ed94b5c395972ce0d1.1729975570.git.christophe.jaillet@wanadoo.fr
+Signed-off-by: Mark Brown <broonie@kernel.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ sound/soc/codecs/cs42l51.c | 7 +++++--
+ 1 file changed, 5 insertions(+), 2 deletions(-)
+
+diff --git a/sound/soc/codecs/cs42l51.c b/sound/soc/codecs/cs42l51.c
+index 4b026e1c3fe3e..09445db29aa1f 100644
+--- a/sound/soc/codecs/cs42l51.c
++++ b/sound/soc/codecs/cs42l51.c
+@@ -754,8 +754,10 @@ int cs42l51_probe(struct device *dev, struct regmap *regmap)
+       cs42l51->reset_gpio = devm_gpiod_get_optional(dev, "reset",
+                                                     GPIOD_OUT_LOW);
+-      if (IS_ERR(cs42l51->reset_gpio))
+-              return PTR_ERR(cs42l51->reset_gpio);
++      if (IS_ERR(cs42l51->reset_gpio)) {
++              ret = PTR_ERR(cs42l51->reset_gpio);
++              goto error;
++      }
+       if (cs42l51->reset_gpio) {
+               dev_dbg(dev, "Release reset gpio\n");
+@@ -787,6 +789,7 @@ int cs42l51_probe(struct device *dev, struct regmap *regmap)
+       return 0;
+ error:
++      gpiod_set_value_cansleep(cs42l51->reset_gpio, 1);
+       regulator_bulk_disable(ARRAY_SIZE(cs42l51->supplies),
+                              cs42l51->supplies);
+       return ret;
+-- 
+2.43.0
+
diff --git a/queue-5.10/bpf-fix-out-of-bounds-write-in-trie_get_next_key.patch b/queue-5.10/bpf-fix-out-of-bounds-write-in-trie_get_next_key.patch
new file mode 100644 (file)
index 0000000..0ef93a5
--- /dev/null
@@ -0,0 +1,47 @@
+From e676acccb16a3c50d0f7ab833440bc9a21e1d493 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Sat, 26 Oct 2024 14:02:43 +0900
+Subject: bpf: Fix out-of-bounds write in trie_get_next_key()
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: Byeonguk Jeong <jungbu2855@gmail.com>
+
+[ Upstream commit 13400ac8fb80c57c2bfb12ebd35ee121ce9b4d21 ]
+
+trie_get_next_key() allocates a node stack with size trie->max_prefixlen,
+while it writes (trie->max_prefixlen + 1) nodes to the stack when it has
+full paths from the root to leaves. For example, consider a trie with
+max_prefixlen is 8, and the nodes with key 0x00/0, 0x00/1, 0x00/2, ...
+0x00/8 inserted. Subsequent calls to trie_get_next_key with _key with
+.prefixlen = 8 make 9 nodes be written on the node stack with size 8.
+
+Fixes: b471f2f1de8b ("bpf: implement MAP_GET_NEXT_KEY command for LPM_TRIE map")
+Signed-off-by: Byeonguk Jeong <jungbu2855@gmail.com>
+Reviewed-by: Toke Høiland-Jørgensen <toke@kernel.org>
+Tested-by: Hou Tao <houtao1@huawei.com>
+Acked-by: Hou Tao <houtao1@huawei.com>
+Link: https://lore.kernel.org/r/Zxx384ZfdlFYnz6J@localhost.localdomain
+Signed-off-by: Alexei Starovoitov <ast@kernel.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ kernel/bpf/lpm_trie.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/kernel/bpf/lpm_trie.c b/kernel/bpf/lpm_trie.c
+index 3c2d8722d45b3..8370b391f1d6c 100644
+--- a/kernel/bpf/lpm_trie.c
++++ b/kernel/bpf/lpm_trie.c
+@@ -655,7 +655,7 @@ static int trie_get_next_key(struct bpf_map *map, void *_key, void *_next_key)
+       if (!key || key->prefixlen > trie->max_prefixlen)
+               goto find_leftmost;
+-      node_stack = kmalloc_array(trie->max_prefixlen,
++      node_stack = kmalloc_array(trie->max_prefixlen + 1,
+                                  sizeof(struct lpm_trie_node *),
+                                  GFP_ATOMIC | __GFP_NOWARN);
+       if (!node_stack)
+-- 
+2.43.0
+
diff --git a/queue-5.10/gtp-allow-1-to-be-specified-as-file-description-from.patch b/queue-5.10/gtp-allow-1-to-be-specified-as-file-description-from.patch
new file mode 100644 (file)
index 0000000..30fdbce
--- /dev/null
@@ -0,0 +1,68 @@
+From ffc7aa9aef693cdc681d364abb9bdf3b903e015c Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Tue, 22 Oct 2024 16:48:25 +0200
+Subject: gtp: allow -1 to be specified as file description from userspace
+
+From: Pablo Neira Ayuso <pablo@netfilter.org>
+
+[ Upstream commit 7515e37bce5c428a56a9b04ea7e96b3f53f17150 ]
+
+Existing user space applications maintained by the Osmocom project are
+breaking since a recent fix that addresses incorrect error checking.
+
+Restore operation for user space programs that specify -1 as file
+descriptor to skip GTPv0 or GTPv1 only sockets.
+
+Fixes: defd8b3c37b0 ("gtp: fix a potential NULL pointer dereference")
+Reported-by: Pau Espin Pedrol <pespin@sysmocom.de>
+Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
+Tested-by: Oliver Smith <osmith@sysmocom.de>
+Reviewed-by: Simon Horman <horms@kernel.org>
+Link: https://patch.msgid.link/20241022144825.66740-1-pablo@netfilter.org
+Signed-off-by: Jakub Kicinski <kuba@kernel.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/net/gtp.c | 22 +++++++++++++---------
+ 1 file changed, 13 insertions(+), 9 deletions(-)
+
+diff --git a/drivers/net/gtp.c b/drivers/net/gtp.c
+index 24cb7b97e4fcc..42839cb853f83 100644
+--- a/drivers/net/gtp.c
++++ b/drivers/net/gtp.c
+@@ -842,20 +842,24 @@ static int gtp_encap_enable(struct gtp_dev *gtp, struct nlattr *data[])
+       unsigned int role = GTP_ROLE_GGSN;
+       if (data[IFLA_GTP_FD0]) {
+-              u32 fd0 = nla_get_u32(data[IFLA_GTP_FD0]);
++              int fd0 = nla_get_u32(data[IFLA_GTP_FD0]);
+-              sk0 = gtp_encap_enable_socket(fd0, UDP_ENCAP_GTP0, gtp);
+-              if (IS_ERR(sk0))
+-                      return PTR_ERR(sk0);
++              if (fd0 >= 0) {
++                      sk0 = gtp_encap_enable_socket(fd0, UDP_ENCAP_GTP0, gtp);
++                      if (IS_ERR(sk0))
++                              return PTR_ERR(sk0);
++              }
+       }
+       if (data[IFLA_GTP_FD1]) {
+-              u32 fd1 = nla_get_u32(data[IFLA_GTP_FD1]);
++              int fd1 = nla_get_u32(data[IFLA_GTP_FD1]);
+-              sk1u = gtp_encap_enable_socket(fd1, UDP_ENCAP_GTP1U, gtp);
+-              if (IS_ERR(sk1u)) {
+-                      gtp_encap_disable_sock(sk0);
+-                      return PTR_ERR(sk1u);
++              if (fd1 >= 0) {
++                      sk1u = gtp_encap_enable_socket(fd1, UDP_ENCAP_GTP1U, gtp);
++                      if (IS_ERR(sk1u)) {
++                              gtp_encap_disable_sock(sk0);
++                              return PTR_ERR(sk1u);
++                      }
+               }
+       }
+-- 
+2.43.0
+
diff --git a/queue-5.10/igb-disable-threaded-irq-for-igb_msix_other.patch b/queue-5.10/igb-disable-threaded-irq-for-igb_msix_other.patch
new file mode 100644 (file)
index 0000000..1a23a7e
--- /dev/null
@@ -0,0 +1,79 @@
+From 380908c1343b7460d32621bab283aa6cdb1705b8 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 21 Oct 2024 16:26:24 -0700
+Subject: igb: Disable threaded IRQ for igb_msix_other
+
+From: Wander Lairson Costa <wander@redhat.com>
+
+[ Upstream commit 338c4d3902feb5be49bfda530a72c7ab860e2c9f ]
+
+During testing of SR-IOV, Red Hat QE encountered an issue where the
+ip link up command intermittently fails for the igbvf interfaces when
+using the PREEMPT_RT variant. Investigation revealed that
+e1000_write_posted_mbx returns an error due to the lack of an ACK
+from e1000_poll_for_ack.
+
+The underlying issue arises from the fact that IRQs are threaded by
+default under PREEMPT_RT. While the exact hardware details are not
+available, it appears that the IRQ handled by igb_msix_other must
+be processed before e1000_poll_for_ack times out. However,
+e1000_write_posted_mbx is called with preemption disabled, leading
+to a scenario where the IRQ is serviced only after the failure of
+e1000_write_posted_mbx.
+
+To resolve this, we set IRQF_NO_THREAD for the affected interrupt,
+ensuring that the kernel handles it immediately, thereby preventing
+the aforementioned error.
+
+Reproducer:
+
+    #!/bin/bash
+
+    # echo 2 > /sys/class/net/ens14f0/device/sriov_numvfs
+    ipaddr_vlan=3
+    nic_test=ens14f0
+    vf=${nic_test}v0
+
+    while true; do
+           ip link set ${nic_test} mtu 1500
+           ip link set ${vf} mtu 1500
+           ip link set $vf up
+           ip link set ${nic_test} vf 0 vlan ${ipaddr_vlan}
+           ip addr add 172.30.${ipaddr_vlan}.1/24 dev ${vf}
+           ip addr add 2021:db8:${ipaddr_vlan}::1/64 dev ${vf}
+           if ! ip link show $vf | grep 'state UP'; then
+                   echo 'Error found'
+                   break
+           fi
+           ip link set $vf down
+    done
+
+Signed-off-by: Wander Lairson Costa <wander@redhat.com>
+Fixes: 9d5c824399de ("igb: PCI-Express 82575 Gigabit Ethernet driver")
+Reported-by: Yuying Ma <yuma@redhat.com>
+Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
+Tested-by: Rafal Romanowski <rafal.romanowski@intel.com>
+Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
+Reviewed-by: Simon Horman <horms@kernel.org>
+Signed-off-by: Paolo Abeni <pabeni@redhat.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/net/ethernet/intel/igb/igb_main.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
+index 17cdda3fe415a..e1936aa94077b 100644
+--- a/drivers/net/ethernet/intel/igb/igb_main.c
++++ b/drivers/net/ethernet/intel/igb/igb_main.c
+@@ -936,7 +936,7 @@ static int igb_request_msix(struct igb_adapter *adapter)
+       int i, err = 0, vector = 0, free_vector = 0;
+       err = request_irq(adapter->msix_entries[vector].vector,
+-                        igb_msix_other, 0, netdev->name, adapter);
++                        igb_msix_other, IRQF_NO_THREAD, netdev->name, adapter);
+       if (err)
+               goto err_out;
+-- 
+2.43.0
+
diff --git a/queue-5.10/ipv4-ip_tunnel-fix-suspicious-rcu-usage-warning-in-i.patch b/queue-5.10/ipv4-ip_tunnel-fix-suspicious-rcu-usage-warning-in-i.patch
new file mode 100644 (file)
index 0000000..0aa22d7
--- /dev/null
@@ -0,0 +1,79 @@
+From fe4ecd6aec5e2504195389c7f1fba7b224e8f65b Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Tue, 22 Oct 2024 09:38:22 +0300
+Subject: ipv4: ip_tunnel: Fix suspicious RCU usage warning in
+ ip_tunnel_init_flow()
+
+From: Ido Schimmel <idosch@nvidia.com>
+
+[ Upstream commit ad4a3ca6a8e886f6491910a3ae5d53595e40597d ]
+
+There are code paths from which the function is called without holding
+the RCU read lock, resulting in a suspicious RCU usage warning [1].
+
+Fix by using l3mdev_master_upper_ifindex_by_index() which will acquire
+the RCU read lock before calling
+l3mdev_master_upper_ifindex_by_index_rcu().
+
+[1]
+WARNING: suspicious RCU usage
+6.12.0-rc3-custom-gac8f72681cf2 #141 Not tainted
+-----------------------------
+net/core/dev.c:876 RCU-list traversed in non-reader section!!
+
+other info that might help us debug this:
+
+rcu_scheduler_active = 2, debug_locks = 1
+1 lock held by ip/361:
+ #0: ffffffff86fc7cb0 (rtnl_mutex){+.+.}-{3:3}, at: rtnetlink_rcv_msg+0x377/0xf60
+
+stack backtrace:
+CPU: 3 UID: 0 PID: 361 Comm: ip Not tainted 6.12.0-rc3-custom-gac8f72681cf2 #141
+Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011
+Call Trace:
+ <TASK>
+ dump_stack_lvl+0xba/0x110
+ lockdep_rcu_suspicious.cold+0x4f/0xd6
+ dev_get_by_index_rcu+0x1d3/0x210
+ l3mdev_master_upper_ifindex_by_index_rcu+0x2b/0xf0
+ ip_tunnel_bind_dev+0x72f/0xa00
+ ip_tunnel_newlink+0x368/0x7a0
+ ipgre_newlink+0x14c/0x170
+ __rtnl_newlink+0x1173/0x19c0
+ rtnl_newlink+0x6c/0xa0
+ rtnetlink_rcv_msg+0x3cc/0xf60
+ netlink_rcv_skb+0x171/0x450
+ netlink_unicast+0x539/0x7f0
+ netlink_sendmsg+0x8c1/0xd80
+ ____sys_sendmsg+0x8f9/0xc20
+ ___sys_sendmsg+0x197/0x1e0
+ __sys_sendmsg+0x122/0x1f0
+ do_syscall_64+0xbb/0x1d0
+ entry_SYSCALL_64_after_hwframe+0x77/0x7f
+
+Fixes: db53cd3d88dc ("net: Handle l3mdev in ip_tunnel_init_flow")
+Signed-off-by: Ido Schimmel <idosch@nvidia.com>
+Reviewed-by: David Ahern <dsahern@kernel.org>
+Link: https://patch.msgid.link/20241022063822.462057-1-idosch@nvidia.com
+Signed-off-by: Jakub Kicinski <kuba@kernel.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ include/net/ip_tunnels.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/include/net/ip_tunnels.h b/include/net/ip_tunnels.h
+index f6cb68c2beadf..cedf72924f19e 100644
+--- a/include/net/ip_tunnels.h
++++ b/include/net/ip_tunnels.h
+@@ -247,7 +247,7 @@ static inline void ip_tunnel_init_flow(struct flowi4 *fl4,
+       memset(fl4, 0, sizeof(*fl4));
+       if (oif) {
+-              fl4->flowi4_l3mdev = l3mdev_master_upper_ifindex_by_index_rcu(net, oif);
++              fl4->flowi4_l3mdev = l3mdev_master_upper_ifindex_by_index(net, oif);
+               /* Legacy VRF/l3mdev use case */
+               fl4->flowi4_oif = fl4->flowi4_l3mdev ? 0 : oif;
+       }
+-- 
+2.43.0
+
diff --git a/queue-5.10/mac80211-add-support-to-trigger-sta-disconnect-on-ha.patch b/queue-5.10/mac80211-add-support-to-trigger-sta-disconnect-on-ha.patch
new file mode 100644 (file)
index 0000000..689f913
--- /dev/null
@@ -0,0 +1,197 @@
+From 41e59a9c03d48a9582f290b145e6f482221345d6 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Tue, 8 Mar 2022 17:23:24 +0530
+Subject: mac80211: Add support to trigger sta disconnect on hardware restart
+
+From: Youghandhar Chintala <youghand@codeaurora.org>
+
+[ Upstream commit 7d352ccf1e9935b5222ca84e8baeb07a0c8f94b9 ]
+
+Currently in case of target hardware restart, we just reconfig and
+re-enable the security keys and enable the network queues to start
+data traffic back from where it was interrupted.
+
+Many ath10k wifi chipsets have sequence numbers for the data
+packets assigned by firmware and the mac sequence number will
+restart from zero after target hardware restart leading to mismatch
+in the sequence number expected by the remote peer vs the sequence
+number of the frame sent by the target firmware.
+
+This mismatch in sequence number will cause out-of-order packets
+on the remote peer and all the frames sent by the device are dropped
+until we reach the sequence number which was sent before we restarted
+the target hardware
+
+In order to fix this, we trigger a sta disconnect, in case of target
+hw restart. After this there will be a fresh connection and thereby
+avoiding the dropping of frames by remote peer.
+
+The right fix would be to pull the entire data path into the host
+which is not feasible or would need lots of complex changes and
+will still be inefficient.
+
+Tested on ath10k using WCN3990, QCA6174
+
+Signed-off-by: Youghandhar Chintala <youghand@codeaurora.org>
+Link: https://lore.kernel.org/r/20220308115325.5246-2-youghand@codeaurora.org
+Signed-off-by: Johannes Berg <johannes.berg@intel.com>
+Stable-dep-of: 07a6e3b78a65 ("wifi: iwlwifi: mvm: Fix response handling in iwl_mvm_send_recovery_cmd()")
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ include/net/mac80211.h     | 10 ++++++++++
+ net/mac80211/ieee80211_i.h |  3 +++
+ net/mac80211/mlme.c        | 12 ++++++++++++
+ net/mac80211/util.c        | 33 ++++++++++++++++++++++++++++++---
+ 4 files changed, 55 insertions(+), 3 deletions(-)
+
+diff --git a/include/net/mac80211.h b/include/net/mac80211.h
+index 6ff49c13717bb..8f91609f928c1 100644
+--- a/include/net/mac80211.h
++++ b/include/net/mac80211.h
+@@ -5899,6 +5899,16 @@ void ieee80211_connection_loss(struct ieee80211_vif *vif);
+  */
+ void ieee80211_resume_disconnect(struct ieee80211_vif *vif);
++/**
++ * ieee80211_hw_restart_disconnect - disconnect from AP after
++ * hardware restart
++ * @vif: &struct ieee80211_vif pointer from the add_interface callback.
++ *
++ * Instructs mac80211 to disconnect from the AP after
++ * hardware restart.
++ */
++void ieee80211_hw_restart_disconnect(struct ieee80211_vif *vif);
++
+ /**
+  * ieee80211_cqm_rssi_notify - inform a configured connection quality monitoring
+  *    rssi threshold triggered
+diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
+index 782ff56c5aff1..2da452ec53288 100644
+--- a/net/mac80211/ieee80211_i.h
++++ b/net/mac80211/ieee80211_i.h
+@@ -762,6 +762,8 @@ struct ieee80211_if_mesh {
+  *    back to wireless media and to the local net stack.
+  * @IEEE80211_SDATA_DISCONNECT_RESUME: Disconnect after resume.
+  * @IEEE80211_SDATA_IN_DRIVER: indicates interface was added to driver
++ * @IEEE80211_SDATA_DISCONNECT_HW_RESTART: Disconnect after hardware restart
++ *  recovery
+  */
+ enum ieee80211_sub_if_data_flags {
+       IEEE80211_SDATA_ALLMULTI                = BIT(0),
+@@ -769,6 +771,7 @@ enum ieee80211_sub_if_data_flags {
+       IEEE80211_SDATA_DONT_BRIDGE_PACKETS     = BIT(3),
+       IEEE80211_SDATA_DISCONNECT_RESUME       = BIT(4),
+       IEEE80211_SDATA_IN_DRIVER               = BIT(5),
++      IEEE80211_SDATA_DISCONNECT_HW_RESTART   = BIT(6),
+ };
+ /**
+diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
+index c52b8eb7fb8a2..0dd50044bd813 100644
+--- a/net/mac80211/mlme.c
++++ b/net/mac80211/mlme.c
+@@ -4799,6 +4799,18 @@ void ieee80211_sta_restart(struct ieee80211_sub_if_data *sdata)
+               sdata_unlock(sdata);
+               return;
+       }
++
++      if (sdata->flags & IEEE80211_SDATA_DISCONNECT_HW_RESTART) {
++              sdata->flags &= ~IEEE80211_SDATA_DISCONNECT_HW_RESTART;
++              mlme_dbg(sdata, "driver requested disconnect after hardware restart\n");
++              ieee80211_sta_connection_lost(sdata,
++                                            ifmgd->associated->bssid,
++                                            WLAN_REASON_UNSPECIFIED,
++                                            true);
++              sdata_unlock(sdata);
++              return;
++      }
++
+       sdata_unlock(sdata);
+ }
+ #endif
+diff --git a/net/mac80211/util.c b/net/mac80211/util.c
+index 997ce9c64336a..e49355cbb1ce1 100644
+--- a/net/mac80211/util.c
++++ b/net/mac80211/util.c
+@@ -2290,6 +2290,7 @@ int ieee80211_reconfig(struct ieee80211_local *local)
+       struct cfg80211_sched_scan_request *sched_scan_req;
+       bool sched_scan_stopped = false;
+       bool suspended = local->suspended;
++      bool in_reconfig = false;
+       /* nothing to do if HW shouldn't run */
+       if (!local->open_count)
+@@ -2640,6 +2641,7 @@ int ieee80211_reconfig(struct ieee80211_local *local)
+               drv_reconfig_complete(local, IEEE80211_RECONFIG_TYPE_RESTART);
+       if (local->in_reconfig) {
++              in_reconfig = local->in_reconfig;
+               local->in_reconfig = false;
+               barrier();
+@@ -2657,6 +2659,15 @@ int ieee80211_reconfig(struct ieee80211_local *local)
+                                       IEEE80211_QUEUE_STOP_REASON_SUSPEND,
+                                       false);
++      if (in_reconfig) {
++              list_for_each_entry(sdata, &local->interfaces, list) {
++                      if (!ieee80211_sdata_running(sdata))
++                              continue;
++                      if (sdata->vif.type == NL80211_IFTYPE_STATION)
++                              ieee80211_sta_restart(sdata);
++              }
++      }
++
+       if (!suspended)
+               return 0;
+@@ -2686,7 +2697,7 @@ int ieee80211_reconfig(struct ieee80211_local *local)
+       return 0;
+ }
+-void ieee80211_resume_disconnect(struct ieee80211_vif *vif)
++static void ieee80211_reconfig_disconnect(struct ieee80211_vif *vif, u8 flag)
+ {
+       struct ieee80211_sub_if_data *sdata;
+       struct ieee80211_local *local;
+@@ -2698,19 +2709,35 @@ void ieee80211_resume_disconnect(struct ieee80211_vif *vif)
+       sdata = vif_to_sdata(vif);
+       local = sdata->local;
+-      if (WARN_ON(!local->resuming))
++      if (WARN_ON(flag & IEEE80211_SDATA_DISCONNECT_RESUME &&
++                  !local->resuming))
++              return;
++
++      if (WARN_ON(flag & IEEE80211_SDATA_DISCONNECT_HW_RESTART &&
++                  !local->in_reconfig))
+               return;
+       if (WARN_ON(vif->type != NL80211_IFTYPE_STATION))
+               return;
+-      sdata->flags |= IEEE80211_SDATA_DISCONNECT_RESUME;
++      sdata->flags |= flag;
+       mutex_lock(&local->key_mtx);
+       list_for_each_entry(key, &sdata->key_list, list)
+               key->flags |= KEY_FLAG_TAINTED;
+       mutex_unlock(&local->key_mtx);
+ }
++
++void ieee80211_hw_restart_disconnect(struct ieee80211_vif *vif)
++{
++      ieee80211_reconfig_disconnect(vif, IEEE80211_SDATA_DISCONNECT_HW_RESTART);
++}
++EXPORT_SYMBOL_GPL(ieee80211_hw_restart_disconnect);
++
++void ieee80211_resume_disconnect(struct ieee80211_vif *vif)
++{
++      ieee80211_reconfig_disconnect(vif, IEEE80211_SDATA_DISCONNECT_RESUME);
++}
+ EXPORT_SYMBOL_GPL(ieee80211_resume_disconnect);
+ void ieee80211_recalc_smps(struct ieee80211_sub_if_data *sdata)
+-- 
+2.43.0
+
diff --git a/queue-5.10/mac80211-do-drv_reconfig_complete-before-restarting-.patch b/queue-5.10/mac80211-do-drv_reconfig_complete-before-restarting-.patch
new file mode 100644 (file)
index 0000000..e4c2471
--- /dev/null
@@ -0,0 +1,68 @@
+From 5cb3c970d536494f79968b711f363d4348111c6e Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 29 Nov 2021 15:32:40 +0200
+Subject: mac80211: do drv_reconfig_complete() before restarting all
+
+From: Johannes Berg <johannes.berg@intel.com>
+
+[ Upstream commit 13dee10b30c058ee2c58c5da00339cc0d4201aa6 ]
+
+When we reconfigure, the driver might do some things to complete
+the reconfiguration. It's strange and could be broken in some
+cases because we restart other works (e.g. remain-on-channel and
+TX) before this happens, yet only start queues later.
+
+Change this to do the reconfig complete when reconfiguration is
+actually complete, not when we've already started doing other
+things again.
+
+For iwlwifi, this should fix a race where the reconfig can race
+with TX, for ath10k and ath11k that also use this it won't make
+a difference because they just start queues there, and mac80211
+also stopped the queues and will restart them later as before.
+
+Signed-off-by: Johannes Berg <johannes.berg@intel.com>
+Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
+Link: https://lore.kernel.org/r/iwlwifi.20211129152938.cab99f22fe19.Iefe494687f15fd85f77c1b989d1149c8efdfdc36@changeid
+Signed-off-by: Johannes Berg <johannes.berg@intel.com>
+Stable-dep-of: 07a6e3b78a65 ("wifi: iwlwifi: mvm: Fix response handling in iwl_mvm_send_recovery_cmd()")
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ net/mac80211/util.c | 14 +++++++-------
+ 1 file changed, 7 insertions(+), 7 deletions(-)
+
+diff --git a/net/mac80211/util.c b/net/mac80211/util.c
+index 7fa6efa8b83c1..997ce9c64336a 100644
+--- a/net/mac80211/util.c
++++ b/net/mac80211/util.c
+@@ -2632,6 +2632,13 @@ int ieee80211_reconfig(struct ieee80211_local *local)
+               mutex_unlock(&local->sta_mtx);
+       }
++      /*
++       * If this is for hw restart things are still running.
++       * We may want to change that later, however.
++       */
++      if (local->open_count && (!suspended || reconfig_due_to_wowlan))
++              drv_reconfig_complete(local, IEEE80211_RECONFIG_TYPE_RESTART);
++
+       if (local->in_reconfig) {
+               local->in_reconfig = false;
+               barrier();
+@@ -2650,13 +2657,6 @@ int ieee80211_reconfig(struct ieee80211_local *local)
+                                       IEEE80211_QUEUE_STOP_REASON_SUSPEND,
+                                       false);
+-      /*
+-       * If this is for hw restart things are still running.
+-       * We may want to change that later, however.
+-       */
+-      if (local->open_count && (!suspended || reconfig_due_to_wowlan))
+-              drv_reconfig_complete(local, IEEE80211_RECONFIG_TYPE_RESTART);
+-
+       if (!suspended)
+               return 0;
+-- 
+2.43.0
+
diff --git a/queue-5.10/mac80211-mac80211_message_tracing-should-depend-on-t.patch b/queue-5.10/mac80211-mac80211_message_tracing-should-depend-on-t.patch
new file mode 100644 (file)
index 0000000..fd178b7
--- /dev/null
@@ -0,0 +1,37 @@
+From a710229305694e066c0073143c7e7fd62c770f85 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Tue, 24 Sep 2024 14:08:57 +0200
+Subject: mac80211: MAC80211_MESSAGE_TRACING should depend on TRACING
+
+From: Geert Uytterhoeven <geert@linux-m68k.org>
+
+[ Upstream commit b3e046c31441d182b954fc2f57b2dc38c71ad4bc ]
+
+When tracing is disabled, there is no point in asking the user about
+enabling tracing of all mac80211 debug messages.
+
+Fixes: 3fae0273168026ed ("mac80211: trace debug messages")
+Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
+Link: https://patch.msgid.link/85bbe38ce0df13350f45714e2dc288cc70947a19.1727179690.git.geert@linux-m68k.org
+Signed-off-by: Johannes Berg <johannes.berg@intel.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ net/mac80211/Kconfig | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/net/mac80211/Kconfig b/net/mac80211/Kconfig
+index 51ec8256b7fa9..8278221a36a1d 100644
+--- a/net/mac80211/Kconfig
++++ b/net/mac80211/Kconfig
+@@ -86,7 +86,7 @@ config MAC80211_DEBUGFS
+ config MAC80211_MESSAGE_TRACING
+       bool "Trace all mac80211 debug messages"
+-      depends on MAC80211
++      depends on MAC80211 && TRACING
+       help
+         Select this option to have mac80211 register the
+         mac80211_msg trace subsystem with tracepoints to
+-- 
+2.43.0
+
diff --git a/queue-5.10/net-hns3-initialize-reset_timer-before-hclgevf_misc_.patch b/queue-5.10/net-hns3-initialize-reset_timer-before-hclgevf_misc_.patch
new file mode 100644 (file)
index 0000000..4363d6f
--- /dev/null
@@ -0,0 +1,45 @@
+From 1b4a6bf40081430f300cb3a05009f0dab61c5213 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Fri, 25 Oct 2024 17:29:36 +0800
+Subject: net: hns3: initialize reset_timer before hclgevf_misc_irq_init()
+
+From: Jian Shen <shenjian15@huawei.com>
+
+[ Upstream commit d1c2e2961ab460ac2433ff8ad46000582abc573c ]
+
+Currently the misc irq is initialized before reset_timer setup. But
+it will access the reset_timer in the irq handler. So initialize
+the reset_timer earlier.
+
+Fixes: ff200099d271 ("net: hns3: remove unnecessary work in hclgevf_main")
+Signed-off-by: Jian Shen <shenjian15@huawei.com>
+Signed-off-by: Jijie Shao <shaojijie@huawei.com>
+Signed-off-by: Paolo Abeni <pabeni@redhat.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c
+index 755935f9efc81..8193c5afe6106 100644
+--- a/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c
++++ b/drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c
+@@ -2656,6 +2656,7 @@ static void hclgevf_state_init(struct hclgevf_dev *hdev)
+       clear_bit(HCLGEVF_STATE_RST_FAIL, &hdev->state);
+       INIT_DELAYED_WORK(&hdev->service_task, hclgevf_service_task);
++      timer_setup(&hdev->reset_timer, hclgevf_reset_timer, 0);
+       mutex_init(&hdev->mbx_resp.mbx_mutex);
+       sema_init(&hdev->reset_sem, 1);
+@@ -3279,7 +3280,6 @@ static int hclgevf_init_hdev(struct hclgevf_dev *hdev)
+                HCLGEVF_DRIVER_NAME);
+       hclgevf_task_schedule(hdev, round_jiffies_relative(HZ));
+-      timer_setup(&hdev->reset_timer, hclgevf_reset_timer, 0);
+       return 0;
+-- 
+2.43.0
+
diff --git a/queue-5.10/net-sched-stop-qdisc_tree_reduce_backlog-on-tc_h_roo.patch b/queue-5.10/net-sched-stop-qdisc_tree_reduce_backlog-on-tc_h_roo.patch
new file mode 100644 (file)
index 0000000..503e3df
--- /dev/null
@@ -0,0 +1,59 @@
+From a0fa0cbba1315a2f3e469ac3b7856e5093a579b6 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Thu, 24 Oct 2024 12:55:47 -0400
+Subject: net/sched: stop qdisc_tree_reduce_backlog on TC_H_ROOT
+
+From: Pedro Tammela <pctammela@mojatatu.com>
+
+[ Upstream commit 2e95c4384438adeaa772caa560244b1a2efef816 ]
+
+In qdisc_tree_reduce_backlog, Qdiscs with major handle ffff: are assumed
+to be either root or ingress. This assumption is bogus since it's valid
+to create egress qdiscs with major handle ffff:
+Budimir Markovic found that for qdiscs like DRR that maintain an active
+class list, it will cause a UAF with a dangling class pointer.
+
+In 066a3b5b2346, the concern was to avoid iterating over the ingress
+qdisc since its parent is itself. The proper fix is to stop when parent
+TC_H_ROOT is reached because the only way to retrieve ingress is when a
+hierarchy which does not contain a ffff: major handle call into
+qdisc_lookup with TC_H_MAJ(TC_H_ROOT).
+
+In the scenario where major ffff: is an egress qdisc in any of the tree
+levels, the updates will also propagate to TC_H_ROOT, which then the
+iteration must stop.
+
+Fixes: 066a3b5b2346 ("[NET_SCHED] sch_api: fix qdisc_tree_decrease_qlen() loop")
+Reported-by: Budimir Markovic <markovicbudimir@gmail.com>
+Suggested-by: Jamal Hadi Salim <jhs@mojatatu.com>
+Tested-by: Victor Nogueira <victor@mojatatu.com>
+Signed-off-by: Pedro Tammela <pctammela@mojatatu.com>
+Signed-off-by: Jamal Hadi Salim <jhs@mojatatu.com>
+
+ net/sched/sch_api.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+Reviewed-by: Simon Horman <horms@kernel.org>
+
+Link: https://patch.msgid.link/20241024165547.418570-1-jhs@mojatatu.com
+Signed-off-by: Jakub Kicinski <kuba@kernel.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ net/sched/sch_api.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c
+index d0e4845ea7018..b4e405676600f 100644
+--- a/net/sched/sch_api.c
++++ b/net/sched/sch_api.c
+@@ -780,7 +780,7 @@ void qdisc_tree_reduce_backlog(struct Qdisc *sch, int n, int len)
+       drops = max_t(int, n, 0);
+       rcu_read_lock();
+       while ((parentid = sch->parent)) {
+-              if (TC_H_MAJ(parentid) == TC_H_MAJ(TC_H_INGRESS))
++              if (parentid == TC_H_ROOT)
+                       break;
+               if (sch->flags & TCQ_F_NOPARENT)
+-- 
+2.43.0
+
diff --git a/queue-5.10/net-skip-offload-for-netif_f_ipv6_csum-if-ipv6-heade.patch b/queue-5.10/net-skip-offload-for-netif_f_ipv6_csum-if-ipv6-heade.patch
new file mode 100644 (file)
index 0000000..308f317
--- /dev/null
@@ -0,0 +1,73 @@
+From 026f943a8fd856eeca6cb655795b7a5f46f79cd8 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Thu, 24 Oct 2024 16:01:54 +0200
+Subject: net: skip offload for NETIF_F_IPV6_CSUM if ipv6 header contains
+ extension
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: Benoît Monin <benoit.monin@gmx.fr>
+
+[ Upstream commit 04c20a9356f283da623903e81e7c6d5df7e4dc3c ]
+
+As documented in skbuff.h, devices with NETIF_F_IPV6_CSUM capability
+can only checksum TCP and UDP over IPv6 if the IP header does not
+contains extension.
+
+This is enforced for UDP packets emitted from user-space to an IPv6
+address as they go through ip6_make_skb(), which calls
+__ip6_append_data() where a check is done on the header size before
+setting CHECKSUM_PARTIAL.
+
+But the introduction of UDP encapsulation with fou6 added a code-path
+where it is possible to get an skb with a partial UDP checksum and an
+IPv6 header with extension:
+* fou6 adds a UDP header with a partial checksum if the inner packet
+does not contains a valid checksum.
+* ip6_tunnel adds an IPv6 header with a destination option extension
+header if encap_limit is non-zero (the default value is 4).
+
+The thread linked below describes in more details how to reproduce the
+problem with GRE-in-UDP tunnel.
+
+Add a check on the network header size in skb_csum_hwoffload_help() to
+make sure no IPv6 packet with extension header is handed to a network
+device with NETIF_F_IPV6_CSUM capability.
+
+Link: https://lore.kernel.org/netdev/26548921.1r3eYUQgxm@benoit.monin/T/#u
+Fixes: aa3463d65e7b ("fou: Add encap ops for IPv6 tunnels")
+Signed-off-by: Benoît Monin <benoit.monin@gmx.fr>
+Reviewed-by: Willem de Bruijn <willemb@google.com>
+Link: https://patch.msgid.link/5fbeecfc311ea182aa1d1c771725ab8b4cac515e.1729778144.git.benoit.monin@gmx.fr
+Signed-off-by: Jakub Kicinski <kuba@kernel.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ net/core/dev.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/net/core/dev.c b/net/core/dev.c
+index 6f04bb2ac4932..2c11247509b4c 100644
+--- a/net/core/dev.c
++++ b/net/core/dev.c
+@@ -3651,6 +3651,9 @@ int skb_csum_hwoffload_help(struct sk_buff *skb,
+               return 0;
+       if (features & (NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM)) {
++              if (vlan_get_protocol(skb) == htons(ETH_P_IPV6) &&
++                  skb_network_header_len(skb) != sizeof(struct ipv6hdr))
++                      goto sw_checksum;
+               switch (skb->csum_offset) {
+               case offsetof(struct tcphdr, check):
+               case offsetof(struct udphdr, check):
+@@ -3658,6 +3661,7 @@ int skb_csum_hwoffload_help(struct sk_buff *skb,
+               }
+       }
++sw_checksum:
+       return skb_checksum_help(skb);
+ }
+ EXPORT_SYMBOL(skb_csum_hwoffload_help);
+-- 
+2.43.0
+
diff --git a/queue-5.10/net-support-ip-generic-csum-processing-in-skb_csum_h.patch b/queue-5.10/net-support-ip-generic-csum-processing-in-skb_csum_h.patch
new file mode 100644 (file)
index 0000000..ae80200
--- /dev/null
@@ -0,0 +1,72 @@
+From e8ff8693004459fb2dbe87c1cd3c45b80ae94a44 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Thu, 28 Jan 2021 17:18:31 +0800
+Subject: net: support ip generic csum processing in skb_csum_hwoffload_help
+
+From: Xin Long <lucien.xin@gmail.com>
+
+[ Upstream commit 62fafcd63139920eb25b3fbf154177ce3e6f3232 ]
+
+NETIF_F_IP|IPV6_CSUM feature flag indicates UDP and TCP csum offload
+while NETIF_F_HW_CSUM feature flag indicates ip generic csum offload
+for HW, which includes not only for TCP/UDP csum, but also for other
+protocols' csum like GRE's.
+
+However, in skb_csum_hwoffload_help() it only checks features against
+NETIF_F_CSUM_MASK(NETIF_F_HW|IP|IPV6_CSUM). So if it's a non TCP/UDP
+packet and the features doesn't support NETIF_F_HW_CSUM, but supports
+NETIF_F_IP|IPV6_CSUM only, it would still return 0 and leave the HW
+to do csum.
+
+This patch is to support ip generic csum processing by checking
+NETIF_F_HW_CSUM for all protocols, and check (NETIF_F_IP_CSUM |
+NETIF_F_IPV6_CSUM) only for TCP and UDP.
+
+Note that we're using skb->csum_offset to check if it's a TCP/UDP
+proctol, this might be fragile. However, as Alex said, for now we
+only have a few L4 protocols that are requesting Tx csum offload,
+we'd better fix this until a new protocol comes with a same csum
+offset.
+
+v1->v2:
+  - not extend skb->csum_not_inet, but use skb->csum_offset to tell
+    if it's an UDP/TCP csum packet.
+v2->v3:
+  - add a note in the changelog, as Willem suggested.
+
+Suggested-by: Alexander Duyck <alexander.duyck@gmail.com>
+Signed-off-by: Xin Long <lucien.xin@gmail.com>
+Signed-off-by: Jakub Kicinski <kuba@kernel.org>
+Stable-dep-of: 04c20a9356f2 ("net: skip offload for NETIF_F_IPV6_CSUM if ipv6 header contains extension")
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ net/core/dev.c | 13 ++++++++++++-
+ 1 file changed, 12 insertions(+), 1 deletion(-)
+
+diff --git a/net/core/dev.c b/net/core/dev.c
+index 5edab9328d5e0..6f04bb2ac4932 100644
+--- a/net/core/dev.c
++++ b/net/core/dev.c
+@@ -3647,7 +3647,18 @@ int skb_csum_hwoffload_help(struct sk_buff *skb,
+               return !!(features & NETIF_F_SCTP_CRC) ? 0 :
+                       skb_crc32c_csum_help(skb);
+-      return !!(features & NETIF_F_CSUM_MASK) ? 0 : skb_checksum_help(skb);
++      if (features & NETIF_F_HW_CSUM)
++              return 0;
++
++      if (features & (NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM)) {
++              switch (skb->csum_offset) {
++              case offsetof(struct tcphdr, check):
++              case offsetof(struct udphdr, check):
++                      return 0;
++              }
++      }
++
++      return skb_checksum_help(skb);
+ }
+ EXPORT_SYMBOL(skb_csum_hwoffload_help);
+-- 
+2.43.0
+
diff --git a/queue-5.10/netfilter-nft_payload-sanitize-offset-and-length-bef.patch b/queue-5.10/netfilter-nft_payload-sanitize-offset-and-length-bef.patch
new file mode 100644 (file)
index 0000000..86da92a
--- /dev/null
@@ -0,0 +1,42 @@
+From fdf0ad15b41f6cb4a200d5be30b27deba82b1882 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Wed, 30 Oct 2024 23:13:48 +0100
+Subject: netfilter: nft_payload: sanitize offset and length before calling
+ skb_checksum()
+
+From: Pablo Neira Ayuso <pablo@netfilter.org>
+
+[ Upstream commit d5953d680f7e96208c29ce4139a0e38de87a57fe ]
+
+If access to offset + length is larger than the skbuff length, then
+skb_checksum() triggers BUG_ON().
+
+skb_checksum() internally subtracts the length parameter while iterating
+over skbuff, BUG_ON(len) at the end of it checks that the expected
+length to be included in the checksum calculation is fully consumed.
+
+Fixes: 7ec3f7b47b8d ("netfilter: nft_payload: add packet mangling support")
+Reported-by: Slavin Liu <slavin-ayu@qq.com>
+Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ net/netfilter/nft_payload.c | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/net/netfilter/nft_payload.c b/net/netfilter/nft_payload.c
+index fa64b1b8ae918..f607cd7f203ad 100644
+--- a/net/netfilter/nft_payload.c
++++ b/net/netfilter/nft_payload.c
+@@ -618,6 +618,9 @@ static void nft_payload_set_eval(const struct nft_expr *expr,
+       if ((priv->csum_type == NFT_PAYLOAD_CSUM_INET || priv->csum_flags) &&
+           (priv->base != NFT_PAYLOAD_TRANSPORT_HEADER ||
+            skb->ip_summed != CHECKSUM_PARTIAL)) {
++              if (offset + priv->len > skb->len)
++                      goto err;
++
+               fsum = skb_checksum(skb, offset, priv->len, 0);
+               tsum = csum_partial(src, priv->len, 0);
+-- 
+2.43.0
+
diff --git a/queue-5.10/rdma-bnxt_re-synchronize-the-qp-handle-table-array.patch b/queue-5.10/rdma-bnxt_re-synchronize-the-qp-handle-table-array.patch
new file mode 100644 (file)
index 0000000..a8557af
--- /dev/null
@@ -0,0 +1,110 @@
+From 15254e23a4deef1f4e114292025182a9728f0273 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 14 Oct 2024 06:36:15 -0700
+Subject: RDMA/bnxt_re: synchronize the qp-handle table array
+
+From: Selvin Xavier <selvin.xavier@broadcom.com>
+
+[ Upstream commit 76d3ddff7153cc0bcc14a63798d19f5d0693ea71 ]
+
+There is a race between the CREQ tasklet and destroy qp when accessing the
+qp-handle table. There is a chance of reading a valid qp-handle in the
+CREQ tasklet handler while the QP is already moving ahead with the
+destruction.
+
+Fixing this race by implementing a table-lock to synchronize the access.
+
+Fixes: f218d67ef004 ("RDMA/bnxt_re: Allow posting when QPs are in error")
+Fixes: 84cf229f4001 ("RDMA/bnxt_re: Fix the qp table indexing")
+Link: https://patch.msgid.link/r/1728912975-19346-3-git-send-email-selvin.xavier@broadcom.com
+Signed-off-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
+Signed-off-by: Selvin Xavier <selvin.xavier@broadcom.com>
+Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/infiniband/hw/bnxt_re/qplib_fp.c   |  4 ++++
+ drivers/infiniband/hw/bnxt_re/qplib_rcfw.c | 13 +++++++++----
+ drivers/infiniband/hw/bnxt_re/qplib_rcfw.h |  2 ++
+ 3 files changed, 15 insertions(+), 4 deletions(-)
+
+diff --git a/drivers/infiniband/hw/bnxt_re/qplib_fp.c b/drivers/infiniband/hw/bnxt_re/qplib_fp.c
+index d44b6a5c90b57..5f79371a1386f 100644
+--- a/drivers/infiniband/hw/bnxt_re/qplib_fp.c
++++ b/drivers/infiniband/hw/bnxt_re/qplib_fp.c
+@@ -1476,9 +1476,11 @@ int bnxt_qplib_destroy_qp(struct bnxt_qplib_res *res,
+       u32 tbl_indx;
+       int rc;
++      spin_lock_bh(&rcfw->tbl_lock);
+       tbl_indx = map_qp_id_to_tbl_indx(qp->id, rcfw);
+       rcfw->qp_tbl[tbl_indx].qp_id = BNXT_QPLIB_QP_ID_INVALID;
+       rcfw->qp_tbl[tbl_indx].qp_handle = NULL;
++      spin_unlock_bh(&rcfw->tbl_lock);
+       RCFW_CMD_PREP(req, DESTROY_QP, cmd_flags);
+@@ -1486,8 +1488,10 @@ int bnxt_qplib_destroy_qp(struct bnxt_qplib_res *res,
+       rc = bnxt_qplib_rcfw_send_message(rcfw, (void *)&req,
+                                         (void *)&resp, NULL, 0);
+       if (rc) {
++              spin_lock_bh(&rcfw->tbl_lock);
+               rcfw->qp_tbl[tbl_indx].qp_id = qp->id;
+               rcfw->qp_tbl[tbl_indx].qp_handle = qp;
++              spin_unlock_bh(&rcfw->tbl_lock);
+               return rc;
+       }
+diff --git a/drivers/infiniband/hw/bnxt_re/qplib_rcfw.c b/drivers/infiniband/hw/bnxt_re/qplib_rcfw.c
+index 148f2c51a9460..0d61a1563f480 100644
+--- a/drivers/infiniband/hw/bnxt_re/qplib_rcfw.c
++++ b/drivers/infiniband/hw/bnxt_re/qplib_rcfw.c
+@@ -316,17 +316,21 @@ static int bnxt_qplib_process_qp_event(struct bnxt_qplib_rcfw *rcfw,
+       case CREQ_QP_EVENT_EVENT_QP_ERROR_NOTIFICATION:
+               err_event = (struct creq_qp_error_notification *)qp_event;
+               qp_id = le32_to_cpu(err_event->xid);
++              spin_lock(&rcfw->tbl_lock);
+               tbl_indx = map_qp_id_to_tbl_indx(qp_id, rcfw);
+               qp = rcfw->qp_tbl[tbl_indx].qp_handle;
++              if (!qp) {
++                      spin_unlock(&rcfw->tbl_lock);
++                      break;
++              }
++              bnxt_qplib_mark_qp_error(qp);
++              rc = rcfw->creq.aeq_handler(rcfw, qp_event, qp);
++              spin_unlock(&rcfw->tbl_lock);
+               dev_dbg(&pdev->dev, "Received QP error notification\n");
+               dev_dbg(&pdev->dev,
+                       "qpid 0x%x, req_err=0x%x, resp_err=0x%x\n",
+                       qp_id, err_event->req_err_state_reason,
+                       err_event->res_err_state_reason);
+-              if (!qp)
+-                      break;
+-              bnxt_qplib_mark_qp_error(qp);
+-              rc = rcfw->creq.aeq_handler(rcfw, qp_event, qp);
+               break;
+       default:
+               /*
+@@ -627,6 +631,7 @@ int bnxt_qplib_alloc_rcfw_channel(struct bnxt_qplib_res *res,
+                              GFP_KERNEL);
+       if (!rcfw->qp_tbl)
+               goto fail;
++      spin_lock_init(&rcfw->tbl_lock);
+       return 0;
+diff --git a/drivers/infiniband/hw/bnxt_re/qplib_rcfw.h b/drivers/infiniband/hw/bnxt_re/qplib_rcfw.h
+index 7df7170c80e06..69aa1a52c7f8d 100644
+--- a/drivers/infiniband/hw/bnxt_re/qplib_rcfw.h
++++ b/drivers/infiniband/hw/bnxt_re/qplib_rcfw.h
+@@ -184,6 +184,8 @@ struct bnxt_qplib_rcfw {
+       struct bnxt_qplib_crsqe         *crsqe_tbl;
+       int qp_tbl_size;
+       struct bnxt_qplib_qp_node *qp_tbl;
++      /* To synchronize the qp-handle hash table */
++      spinlock_t                      tbl_lock;
+       u64 oos_prev;
+       u32 init_oos_stats;
+       u32 cmdq_depth;
+-- 
+2.43.0
+
diff --git a/queue-5.10/rdma-cxgb4-dump-vendor-specific-qp-details.patch b/queue-5.10/rdma-cxgb4-dump-vendor-specific-qp-details.patch
new file mode 100644 (file)
index 0000000..29ec545
--- /dev/null
@@ -0,0 +1,38 @@
+From c28cdb9fec097b8143c5814955ce6a4172cda720 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Mon, 7 Oct 2024 20:55:17 +0300
+Subject: RDMA/cxgb4: Dump vendor specific QP details
+
+From: Leon Romanovsky <leonro@nvidia.com>
+
+[ Upstream commit 89f8c6f197f480fe05edf91eb9359d5425869d04 ]
+
+Restore the missing functionality to dump vendor specific QP details,
+which was mistakenly removed in the commit mentioned in Fixes line.
+
+Fixes: 5cc34116ccec ("RDMA: Add dedicated QP resource tracker function")
+Link: https://patch.msgid.link/r/ed9844829135cfdcac7d64285688195a5cd43f82.1728323026.git.leonro@nvidia.com
+Reported-by: Dr. David Alan Gilbert <linux@treblig.org>
+Closes: https://lore.kernel.org/all/Zv_4qAxuC0dLmgXP@gallifrey
+Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
+Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/infiniband/hw/cxgb4/provider.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/drivers/infiniband/hw/cxgb4/provider.c b/drivers/infiniband/hw/cxgb4/provider.c
+index 8138c57a1e43b..2824511e20ade 100644
+--- a/drivers/infiniband/hw/cxgb4/provider.c
++++ b/drivers/infiniband/hw/cxgb4/provider.c
+@@ -472,6 +472,7 @@ static const struct ib_device_ops c4iw_dev_ops = {
+       .fill_res_cq_entry = c4iw_fill_res_cq_entry,
+       .fill_res_cm_id_entry = c4iw_fill_res_cm_id_entry,
+       .fill_res_mr_entry = c4iw_fill_res_mr_entry,
++      .fill_res_qp_entry = c4iw_fill_res_qp_entry,
+       .get_dev_fw_str = get_dev_fw_str,
+       .get_dma_mr = c4iw_get_dma_mr,
+       .get_hw_stats = c4iw_get_mib,
+-- 
+2.43.0
+
diff --git a/queue-5.10/rdma-mlx5-round-max_rd_atomic-max_dest_rd_atomic-up-.patch b/queue-5.10/rdma-mlx5-round-max_rd_atomic-max_dest_rd_atomic-up-.patch
new file mode 100644 (file)
index 0000000..1592ca3
--- /dev/null
@@ -0,0 +1,51 @@
+From cda7a00d54b2ecc9a3daf26d4e070d0500e56ea4 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Thu, 10 Oct 2024 11:50:23 +0300
+Subject: RDMA/mlx5: Round max_rd_atomic/max_dest_rd_atomic up instead of down
+
+From: Patrisious Haddad <phaddad@nvidia.com>
+
+[ Upstream commit 78ed28e08e74da6265e49e19206e1bcb8b9a7f0d ]
+
+After the cited commit below max_dest_rd_atomic and max_rd_atomic values
+are being rounded down to the next power of 2. As opposed to the old
+behavior and mlx4 driver where they used to be rounded up instead.
+
+In order to stay consistent with older code and other drivers, revert to
+using fls round function which rounds up to the next power of 2.
+
+Fixes: f18e26af6aba ("RDMA/mlx5: Convert modify QP to use MLX5_SET macros")
+Link: https://patch.msgid.link/r/d85515d6ef21a2fa8ef4c8293dce9b58df8a6297.1728550179.git.leon@kernel.org
+Signed-off-by: Patrisious Haddad <phaddad@nvidia.com>
+Reviewed-by: Maher Sanalla <msanalla@nvidia.com>
+Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
+Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/infiniband/hw/mlx5/qp.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/drivers/infiniband/hw/mlx5/qp.c b/drivers/infiniband/hw/mlx5/qp.c
+index e3cc856e70e5d..e0db91d1e7492 100644
+--- a/drivers/infiniband/hw/mlx5/qp.c
++++ b/drivers/infiniband/hw/mlx5/qp.c
+@@ -3940,14 +3940,14 @@ static int __mlx5_ib_modify_qp(struct ib_qp *ibqp,
+               MLX5_SET(qpc, qpc, retry_count, attr->retry_cnt);
+       if (attr_mask & IB_QP_MAX_QP_RD_ATOMIC && attr->max_rd_atomic)
+-              MLX5_SET(qpc, qpc, log_sra_max, ilog2(attr->max_rd_atomic));
++              MLX5_SET(qpc, qpc, log_sra_max, fls(attr->max_rd_atomic - 1));
+       if (attr_mask & IB_QP_SQ_PSN)
+               MLX5_SET(qpc, qpc, next_send_psn, attr->sq_psn);
+       if (attr_mask & IB_QP_MAX_DEST_RD_ATOMIC && attr->max_dest_rd_atomic)
+               MLX5_SET(qpc, qpc, log_rra_max,
+-                       ilog2(attr->max_dest_rd_atomic));
++                       fls(attr->max_dest_rd_atomic - 1));
+       if (attr_mask & (IB_QP_ACCESS_FLAGS | IB_QP_MAX_DEST_RD_ATOMIC)) {
+               err = set_qpc_atomic_flags(qp, attr, attr_mask, qpc);
+-- 
+2.43.0
+
index e67e89ac7c8de9e440d269ff6ed2155cd9cf7b61..7e0d5035206f2344070fdb97acb293262659a251 100644 (file)
@@ -56,3 +56,23 @@ arm64-uprobes-change-the-uprobe_opcode_t-typedef-to-fix-the-sparse-warning.patch
 xfrm-validate-new-sa-s-prefixlen-using-sa-family-whe.patch
 selftests-mm-fix-incorrect-buffer-mirror-size-in-hmm.patch
 cgroup-fix-potential-overflow-issue-when-checking-ma.patch
+mac80211-mac80211_message_tracing-should-depend-on-t.patch
+wifi-mac80211-skip-non-uploaded-keys-in-ieee80211_it.patch
+wifi-brcm80211-brcm_tracing-should-depend-on-tracing.patch
+rdma-cxgb4-dump-vendor-specific-qp-details.patch
+rdma-mlx5-round-max_rd_atomic-max_dest_rd_atomic-up-.patch
+rdma-bnxt_re-synchronize-the-qp-handle-table-array.patch
+mac80211-do-drv_reconfig_complete-before-restarting-.patch
+mac80211-add-support-to-trigger-sta-disconnect-on-ha.patch
+wifi-iwlwifi-mvm-disconnect-station-vifs-if-recovery.patch
+wifi-iwlwifi-mvm-fix-response-handling-in-iwl_mvm_se.patch
+asoc-cs42l51-fix-some-error-handling-paths-in-cs42l5.patch
+igb-disable-threaded-irq-for-igb_msix_other.patch
+ipv4-ip_tunnel-fix-suspicious-rcu-usage-warning-in-i.patch
+gtp-allow-1-to-be-specified-as-file-description-from.patch
+net-sched-stop-qdisc_tree_reduce_backlog-on-tc_h_roo.patch
+bpf-fix-out-of-bounds-write-in-trie_get_next_key.patch
+net-support-ip-generic-csum-processing-in-skb_csum_h.patch
+net-skip-offload-for-netif_f_ipv6_csum-if-ipv6-heade.patch
+netfilter-nft_payload-sanitize-offset-and-length-bef.patch
+net-hns3-initialize-reset_timer-before-hclgevf_misc_.patch
diff --git a/queue-5.10/wifi-brcm80211-brcm_tracing-should-depend-on-tracing.patch b/queue-5.10/wifi-brcm80211-brcm_tracing-should-depend-on-tracing.patch
new file mode 100644 (file)
index 0000000..c276f35
--- /dev/null
@@ -0,0 +1,37 @@
+From c271ac34103a9abbd2336514c08c83e5671fc053 Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Tue, 24 Sep 2024 14:09:32 +0200
+Subject: wifi: brcm80211: BRCM_TRACING should depend on TRACING
+
+From: Geert Uytterhoeven <geert@linux-m68k.org>
+
+[ Upstream commit b73b2069528f90ec49d5fa1010a759baa2c2be05 ]
+
+When tracing is disabled, there is no point in asking the user about
+enabling Broadcom wireless device tracing.
+
+Fixes: f5c4f10852d42012 ("brcm80211: Allow trace support to be enabled separately from debug")
+Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
+Acked-by: Arend van Spriel <arend.vanspriel@broadcom.com>
+Signed-off-by: Kalle Valo <kvalo@kernel.org>
+Link: https://patch.msgid.link/81a29b15eaacc1ac1fb421bdace9ac0c3385f40f.1727179742.git.geert@linux-m68k.org
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/net/wireless/broadcom/brcm80211/Kconfig | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/drivers/net/wireless/broadcom/brcm80211/Kconfig b/drivers/net/wireless/broadcom/brcm80211/Kconfig
+index 5bf2318763c55..8f51099e15c90 100644
+--- a/drivers/net/wireless/broadcom/brcm80211/Kconfig
++++ b/drivers/net/wireless/broadcom/brcm80211/Kconfig
+@@ -23,6 +23,7 @@ source "drivers/net/wireless/broadcom/brcm80211/brcmfmac/Kconfig"
+ config BRCM_TRACING
+       bool "Broadcom device tracing"
+       depends on BRCMSMAC || BRCMFMAC
++      depends on TRACING
+       help
+         If you say Y here, the Broadcom wireless drivers will register
+         with ftrace to dump event information into the trace ringbuffer.
+-- 
+2.43.0
+
diff --git a/queue-5.10/wifi-iwlwifi-mvm-disconnect-station-vifs-if-recovery.patch b/queue-5.10/wifi-iwlwifi-mvm-disconnect-station-vifs-if-recovery.patch
new file mode 100644 (file)
index 0000000..11d0f4e
--- /dev/null
@@ -0,0 +1,61 @@
+From 15d8227aca06e91c4514d31695ae21ca300d654a Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Sun, 28 Jan 2024 08:53:56 +0200
+Subject: wifi: iwlwifi: mvm: disconnect station vifs if recovery failed
+
+From: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
+
+[ Upstream commit e50a88e5cb8792cc416866496288c5f4d1eb4b1f ]
+
+This will allow to reconnect immediately instead of leaving the
+connection in a limbo state.
+
+Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
+Reviewed-by: Gregory Greenman <gregory.greenman@intel.com>
+Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
+Link: https://msgid.link/20240128084842.e90531cd3a36.Iebdc9483983c0d8497f9dcf9d79ec37332a5fdcc@changeid
+Signed-off-by: Johannes Berg <johannes.berg@intel.com>
+Stable-dep-of: 07a6e3b78a65 ("wifi: iwlwifi: mvm: Fix response handling in iwl_mvm_send_recovery_cmd()")
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/net/wireless/intel/iwlwifi/mvm/fw.c | 14 +++++++++++++-
+ 1 file changed, 13 insertions(+), 1 deletion(-)
+
+diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/fw.c b/drivers/net/wireless/intel/iwlwifi/mvm/fw.c
+index 793208d99b5f9..594c88a9ac496 100644
+--- a/drivers/net/wireless/intel/iwlwifi/mvm/fw.c
++++ b/drivers/net/wireless/intel/iwlwifi/mvm/fw.c
+@@ -1251,6 +1251,13 @@ static void iwl_mvm_lari_cfg(struct iwl_mvm *mvm)
+ }
+ #endif /* CONFIG_ACPI */
++static void iwl_mvm_disconnect_iterator(void *data, u8 *mac,
++                                      struct ieee80211_vif *vif)
++{
++      if (vif->type == NL80211_IFTYPE_STATION)
++              ieee80211_hw_restart_disconnect(vif);
++}
++
+ void iwl_mvm_send_recovery_cmd(struct iwl_mvm *mvm, u32 flags)
+ {
+       u32 error_log_size = mvm->fw->ucode_capa.error_log_size;
+@@ -1295,10 +1302,15 @@ void iwl_mvm_send_recovery_cmd(struct iwl_mvm *mvm, u32 flags)
+       /* skb respond is only relevant in ERROR_RECOVERY_UPDATE_DB */
+       if (flags & ERROR_RECOVERY_UPDATE_DB) {
+               resp = le32_to_cpu(*(__le32 *)host_cmd.resp_pkt->data);
+-              if (resp)
++              if (resp) {
+                       IWL_ERR(mvm,
+                               "Failed to send recovery cmd blob was invalid %d\n",
+                               resp);
++
++                      ieee80211_iterate_interfaces(mvm->hw, 0,
++                                                   iwl_mvm_disconnect_iterator,
++                                                   mvm);
++              }
+       }
+ }
+-- 
+2.43.0
+
diff --git a/queue-5.10/wifi-iwlwifi-mvm-fix-response-handling-in-iwl_mvm_se.patch b/queue-5.10/wifi-iwlwifi-mvm-fix-response-handling-in-iwl_mvm_se.patch
new file mode 100644 (file)
index 0000000..dc76dc5
--- /dev/null
@@ -0,0 +1,74 @@
+From e7ecae0afd41b19019190f9eac0f14fffef3e04c Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Thu, 10 Oct 2024 14:05:05 +0300
+Subject: wifi: iwlwifi: mvm: Fix response handling in
+ iwl_mvm_send_recovery_cmd()
+
+From: Daniel Gabay <daniel.gabay@intel.com>
+
+[ Upstream commit 07a6e3b78a65f4b2796a8d0d4adb1a15a81edead ]
+
+1. The size of the response packet is not validated.
+2. The response buffer is not freed.
+
+Resolve these issues by switching to iwl_mvm_send_cmd_status(),
+which handles both size validation and frees the buffer.
+
+Fixes: f130bb75d881 ("iwlwifi: add FW recovery flow")
+Signed-off-by: Daniel Gabay <daniel.gabay@intel.com>
+Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
+Link: https://patch.msgid.link/20241010140328.76c73185951e.Id3b6ca82ced2081f5ee4f33c997491d0ebda83f7@changeid
+Signed-off-by: Johannes Berg <johannes.berg@intel.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ drivers/net/wireless/intel/iwlwifi/mvm/fw.c | 10 ++++------
+ 1 file changed, 4 insertions(+), 6 deletions(-)
+
+diff --git a/drivers/net/wireless/intel/iwlwifi/mvm/fw.c b/drivers/net/wireless/intel/iwlwifi/mvm/fw.c
+index 594c88a9ac496..553117e8fdd90 100644
+--- a/drivers/net/wireless/intel/iwlwifi/mvm/fw.c
++++ b/drivers/net/wireless/intel/iwlwifi/mvm/fw.c
+@@ -1261,8 +1261,8 @@ static void iwl_mvm_disconnect_iterator(void *data, u8 *mac,
+ void iwl_mvm_send_recovery_cmd(struct iwl_mvm *mvm, u32 flags)
+ {
+       u32 error_log_size = mvm->fw->ucode_capa.error_log_size;
++      u32 status = 0;
+       int ret;
+-      u32 resp;
+       struct iwl_fw_error_recovery_cmd recovery_cmd = {
+               .flags = cpu_to_le32(flags),
+@@ -1270,7 +1270,6 @@ void iwl_mvm_send_recovery_cmd(struct iwl_mvm *mvm, u32 flags)
+       };
+       struct iwl_host_cmd host_cmd = {
+               .id = WIDE_ID(SYSTEM_GROUP, FW_ERROR_RECOVERY_CMD),
+-              .flags = CMD_WANT_SKB,
+               .data = {&recovery_cmd, },
+               .len = {sizeof(recovery_cmd), },
+       };
+@@ -1290,7 +1289,7 @@ void iwl_mvm_send_recovery_cmd(struct iwl_mvm *mvm, u32 flags)
+               recovery_cmd.buf_size = cpu_to_le32(error_log_size);
+       }
+-      ret = iwl_mvm_send_cmd(mvm, &host_cmd);
++      ret = iwl_mvm_send_cmd_status(mvm, &host_cmd, &status);
+       kfree(mvm->error_recovery_buf);
+       mvm->error_recovery_buf = NULL;
+@@ -1301,11 +1300,10 @@ void iwl_mvm_send_recovery_cmd(struct iwl_mvm *mvm, u32 flags)
+       /* skb respond is only relevant in ERROR_RECOVERY_UPDATE_DB */
+       if (flags & ERROR_RECOVERY_UPDATE_DB) {
+-              resp = le32_to_cpu(*(__le32 *)host_cmd.resp_pkt->data);
+-              if (resp) {
++              if (status) {
+                       IWL_ERR(mvm,
+                               "Failed to send recovery cmd blob was invalid %d\n",
+-                              resp);
++                              status);
+                       ieee80211_iterate_interfaces(mvm->hw, 0,
+                                                    iwl_mvm_disconnect_iterator,
+-- 
+2.43.0
+
diff --git a/queue-5.10/wifi-mac80211-skip-non-uploaded-keys-in-ieee80211_it.patch b/queue-5.10/wifi-mac80211-skip-non-uploaded-keys-in-ieee80211_it.patch
new file mode 100644 (file)
index 0000000..940d90c
--- /dev/null
@@ -0,0 +1,94 @@
+From aade223883d84fbb4353b0a509145774c86d584d Mon Sep 17 00:00:00 2001
+From: Sasha Levin <sashal@kernel.org>
+Date: Sun, 6 Oct 2024 17:36:30 +0200
+Subject: wifi: mac80211: skip non-uploaded keys in ieee80211_iter_keys
+
+From: Felix Fietkau <nbd@nbd.name>
+
+[ Upstream commit 52009b419355195912a628d0a9847922e90c348c ]
+
+Sync iterator conditions with ieee80211_iter_keys_rcu.
+
+Fixes: 830af02f24fb ("mac80211: allow driver to iterate keys")
+Signed-off-by: Felix Fietkau <nbd@nbd.name>
+Link: https://patch.msgid.link/20241006153630.87885-1-nbd@nbd.name
+Signed-off-by: Johannes Berg <johannes.berg@intel.com>
+Signed-off-by: Sasha Levin <sashal@kernel.org>
+---
+ net/mac80211/key.c | 42 +++++++++++++++++++++++++-----------------
+ 1 file changed, 25 insertions(+), 17 deletions(-)
+
+diff --git a/net/mac80211/key.c b/net/mac80211/key.c
+index 6b089594a9f3f..3df4695caef6c 100644
+--- a/net/mac80211/key.c
++++ b/net/mac80211/key.c
+@@ -918,6 +918,26 @@ void ieee80211_reenable_keys(struct ieee80211_sub_if_data *sdata)
+       mutex_unlock(&sdata->local->key_mtx);
+ }
++static void
++ieee80211_key_iter(struct ieee80211_hw *hw,
++                 struct ieee80211_vif *vif,
++                 struct ieee80211_key *key,
++                 void (*iter)(struct ieee80211_hw *hw,
++                              struct ieee80211_vif *vif,
++                              struct ieee80211_sta *sta,
++                              struct ieee80211_key_conf *key,
++                              void *data),
++                 void *iter_data)
++{
++      /* skip keys of station in removal process */
++      if (key->sta && key->sta->removed)
++              return;
++      if (!(key->flags & KEY_FLAG_UPLOADED_TO_HARDWARE))
++              return;
++      iter(hw, vif, key->sta ? &key->sta->sta : NULL,
++           &key->conf, iter_data);
++}
++
+ void ieee80211_iter_keys(struct ieee80211_hw *hw,
+                        struct ieee80211_vif *vif,
+                        void (*iter)(struct ieee80211_hw *hw,
+@@ -937,16 +957,13 @@ void ieee80211_iter_keys(struct ieee80211_hw *hw,
+       if (vif) {
+               sdata = vif_to_sdata(vif);
+               list_for_each_entry_safe(key, tmp, &sdata->key_list, list)
+-                      iter(hw, &sdata->vif,
+-                           key->sta ? &key->sta->sta : NULL,
+-                           &key->conf, iter_data);
++                      ieee80211_key_iter(hw, vif, key, iter, iter_data);
+       } else {
+               list_for_each_entry(sdata, &local->interfaces, list)
+                       list_for_each_entry_safe(key, tmp,
+                                                &sdata->key_list, list)
+-                              iter(hw, &sdata->vif,
+-                                   key->sta ? &key->sta->sta : NULL,
+-                                   &key->conf, iter_data);
++                              ieee80211_key_iter(hw, &sdata->vif, key,
++                                                 iter, iter_data);
+       }
+       mutex_unlock(&local->key_mtx);
+ }
+@@ -964,17 +981,8 @@ _ieee80211_iter_keys_rcu(struct ieee80211_hw *hw,
+ {
+       struct ieee80211_key *key;
+-      list_for_each_entry_rcu(key, &sdata->key_list, list) {
+-              /* skip keys of station in removal process */
+-              if (key->sta && key->sta->removed)
+-                      continue;
+-              if (!(key->flags & KEY_FLAG_UPLOADED_TO_HARDWARE))
+-                      continue;
+-
+-              iter(hw, &sdata->vif,
+-                   key->sta ? &key->sta->sta : NULL,
+-                   &key->conf, iter_data);
+-      }
++      list_for_each_entry_rcu(key, &sdata->key_list, list)
++              ieee80211_key_iter(hw, &sdata->vif, key, iter, iter_data);
+ }
+ void ieee80211_iter_keys_rcu(struct ieee80211_hw *hw,
+-- 
+2.43.0
+