1 From 400ece6c7f346b0a30867bd00b03b5b2563d4357 Mon Sep 17 00:00:00 2001
2 From: Sven Eckelmann <sven@narfation.org>
3 Date: Tue, 22 Aug 2023 16:42:24 +0300
4 Subject: [PATCH] wifi: ath11k: Don't drop tx_status when peer cannot be found
6 When a station idles for a long time, hostapd will try to send a QoS Null
7 frame to the station as "poll". NL80211_CMD_PROBE_CLIENT is used for this
8 purpose. And the skb will be added to ack_status_frame - waiting for a
9 completion via ieee80211_report_ack_skb().
11 But when the peer was already removed before the tx_complete arrives, the
12 peer will be missing. And when using dev_kfree_skb_any (instead of going
13 through mac80211), the entry will stay inside ack_status_frames. This IDR
14 will therefore run full after 8K request were generated for such clients.
15 At this point, the access point will then just stall and not allow any new
16 clients because idr_alloc() for ack_status_frame will fail.
18 ieee80211_free_txskb() on the other hand will (when required) call
19 ieee80211_report_ack_skb() and make sure that (when required) remove the
20 entry from the ack_status_frame.
22 Tested-on: IPQ6018 hw1.0 WLAN.HK.2.5.0.1-01100-QCAHKSWPL_SILICONZ-1
24 Fixes: 6257c702264c ("wifi: ath11k: fix tx status reporting in encap offload mode")
25 Fixes: 94739d45c388 ("ath11k: switch to using ieee80211_tx_status_ext()")
26 Cc: stable@vger.kernel.org
27 Signed-off-by: Sven Eckelmann <sven@narfation.org>
28 Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
29 Link: https://lore.kernel.org/r/20230802-ath11k-ack_status_leak-v2-1-c0af729d6229@narfation.org
31 drivers/net/wireless/ath/ath11k/dp_tx.c | 4 ++--
32 1 file changed, 2 insertions(+), 2 deletions(-)
34 --- a/drivers/net/wireless/ath/ath11k/dp_tx.c
35 +++ b/drivers/net/wireless/ath/ath11k/dp_tx.c
36 @@ -369,7 +369,7 @@ ath11k_dp_tx_htt_tx_complete_buf(struct
37 "dp_tx: failed to find the peer with peer_id %d\n",
39 spin_unlock_bh(&ab->base_lock);
40 - dev_kfree_skb_any(msdu);
41 + ieee80211_free_txskb(ar->hw, msdu);
44 spin_unlock_bh(&ab->base_lock);
45 @@ -624,7 +624,7 @@ static void ath11k_dp_tx_complete_msdu(s
46 "dp_tx: failed to find the peer with peer_id %d\n",
48 spin_unlock_bh(&ab->base_lock);
49 - dev_kfree_skb_any(msdu);
50 + ieee80211_free_txskb(ar->hw, msdu);
53 arsta = (struct ath11k_sta *)peer->sta->drv_priv;