Skip to contentSkip to conversation

wifi: ath11k: zero init info->status in wmi_process_mgmt_tx_comp()

PATCH Applied Nicolas Escande 4 participants 5 messages Nov 4, 2025 – Nov 6, 2025 Qualcomm Atheros ATH11K wireless driver

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 wifi: ath11k: zero init info->status in wmi_process_mgmt_tx_comp()

When reporting tx completion using ieee80211_tx_status_xxx() familly of functions, the status part of the struct ieee80211_tx_info nested in the skb is used to report things like transmit rates & retry count to mac80211

On the TX data path, this is correctly memset to 0 before calling ieee80211_tx_status_ext(), but on the tx mgmt path this was not done.

This leads to mac80211 treating garbage values as valid transmit counters (like tx retries for example) and accounting them as real statistics that makes their way to userland via station dump.

The same issue was resolved in ath12k by commit 9903c0986f78 ("wifi:
ath12k: Add memset and update default rate value in wmi tx completion")

Tested-on: QCN9074 PCI WLAN.HK.2.9.0.1-01977-QCAHKSWPL_SILICONZ-1

Fixes d5c65159f289 ("ath11k: driver for Qualcomm IEEE 802.11ax devices")
---
 drivers/net/wireless/ath/ath11k/wmi.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/net/wireless/ath/ath11k/wmi.c +3 -0
index edff6fb61344..110035dae8a6 100644
@@ -5967,6 +5967,9 @@ static int wmi_process_mgmt_tx_comp(struct ath11k *ar,
 	dma_unmap_single(ar->ab->dev, skb_cb->paddr, msdu->len, DMA_TO_DEVICE);
 
 	info = IEEE80211_SKB_CB(msdu);
+	memset(&info->status, 0, sizeof(info->status));
+	info->status.rates[0].idx = -1;
+
 	if ((!(info->flags & IEEE80211_TX_CTL_NO_ACK)) &&
 	    !tx_compl_param->status) {
 		info->flags |= IEEE80211_TX_STAT_ACK;
Signature · 1 line
2.51.2
Reviewed-by on v1 1/1
#1 lore raw
Quoted 1 line · Nicolas Escande

When reporting tx completion using ieee80211_tx_status_xxx() familly of

nit: s/familly/family

Quoted 10 lines

functions, the status part of the struct ieee80211_tx_info nested in the skb is used to report things like transmit rates & retry count to mac80211

On the TX data path, this is correctly memset to 0 before calling ieee80211_tx_status_ext(), but on the tx mgmt path this was not done.

This leads to mac80211 treating garbage values as valid transmit counters (like tx retries for example) and accounting them as real statistics that makes their way to userland via station dump.

Quoted 7 lines

The same issue was resolved in ath12k by commit 9903c0986f78 ("wifi:
ath12k: Add memset and update default rate value in wmi tx completion")

Tested-on: QCN9074 PCI WLAN.HK.2.9.0.1-01977-QCAHKSWPL_SILICONZ-1

Fixes d5c65159f289 ("ath11k: driver for Qualcomm IEEE 802.11ax devices")
#2 lore raw
Quoted 6 lines · Vasanthakumar Thiagarajan
Quoted 1 line · Nicolas Escande

When reporting tx completion using ieee80211_tx_status_xxx() familly of

nit: s/familly/family

I'll fix this in 'pending'

Reviewed-by on v1 1/1
#3 lore raw
In reply to Nicolas Escande
Quoted 27 lines · Nicolas Escande

When reporting tx completion using ieee80211_tx_status_xxx() familly of functions, the status part of the struct ieee80211_tx_info nested in the skb is used to report things like transmit rates & retry count to mac80211

On the TX data path, this is correctly memset to 0 before calling ieee80211_tx_status_ext(), but on the tx mgmt path this was not done.

This leads to mac80211 treating garbage values as valid transmit counters (like tx retries for example) and accounting them as real statistics that makes their way to userland via station dump.

The same issue was resolved in ath12k by commit 9903c0986f78 ("wifi:
ath12k: Add memset and update default rate value in wmi tx completion")

Tested-on: QCN9074 PCI WLAN.HK.2.9.0.1-01977-QCAHKSWPL_SILICONZ-1

Fixes d5c65159f289 ("ath11k: driver for Qualcomm IEEE 802.11ax devices")
---
 drivers/net/wireless/ath/ath11k/wmi.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/net/wireless/ath/ath11k/wmi.c +0 -0
index edff6fb61344..110035dae8a6 100644

drivers/net/wireless/ath/ath11k/wmi.c static int wmi_process_mgmt_tx_comp(struct ath11k *ar, · line 5975

Quoted 9 lines
drivers/net/wireless/ath/ath11k/wmi.c +3 -0
@@ -5967,6 +5967,9 @@ static int wmi_process_mgmt_tx_comp(struct ath11k *ar,
 	dma_unmap_single(ar->ab->dev, skb_cb->paddr, msdu->len, DMA_TO_DEVICE);
 
 	info = IEEE80211_SKB_CB(msdu);
+	memset(&info->status, 0, sizeof(info->status));
+	info->status.rates[0].idx = -1;
+
 	if ((!(info->flags & IEEE80211_TX_CTL_NO_ACK)) &&
 	    !tx_compl_param->status) {
 		info->flags |= IEEE80211_TX_STAT_ACK;
Applied
#4 lore raw
In reply to Nicolas Escande
Quoted 8 lines · Nicolas Escande

When reporting tx completion using ieee80211_tx_status_xxx() familly of functions, the status part of the struct ieee80211_tx_info nested in the skb is used to report things like transmit rates & retry count to mac80211

On the TX data path, this is correctly memset to 0 before calling ieee80211_tx_status_ext(), but on the tx mgmt path this was not done.

[...]

Applied, thanks!

[1/1] wifi: ath11k: zero init info->status in wmi_process_mgmt_tx_comp()

      commit: 9065b968752334f972e0d48e50c4463a172fc2a7

Best regards,

Signature · 1 line
Jeff Johnson <[email protected]>