mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH ath-current v2 0/2] wifi: ath10k: fix leaks when HL TX fails
@ 2026-11-19  0:28 Changyul Lee
  2026-11-19  0:28 ` [PATCH ath-current v2 1/2] wifi: ath10k: free msdu_id " Changyul Lee
  2026-11-19  0:28 ` [PATCH ath-current v2 2/2] wifi: ath10k: drop extra skb reference " Changyul Lee
  0 siblings, 2 replies; 3+ messages in thread
From: Changyul Lee @ 2026-11-19  0:28 UTC (permalink / raw)
  To: Jeff Johnson, Loic Poulain
  Cc: linux-wireless, ath10k, linux-kernel, Changyul Lee

For SDIO and USB devices, ath10k_htt_tx_hl() leaks the msdu_id and an
skb reference when ath10k_htc_send_hl() fails. v2 splits them into one
patch per Fixes tag.

Found with a static analysis tool we are developing. Compile-tested
only, with x86_64_defconfig plus ATH10K_SDIO, ATH10K_USB and W=1.

---
Changes in v2:
- Split into two patches, one per Fixes tag
- Target ath-current instead of ath-next
- Link to v1: https://lore.kernel.org/all/20261118052116.3901761-1-lcy8047@gmail.com/

Changyul Lee (2):
  wifi: ath10k: free msdu_id when HL TX fails
  wifi: ath10k: drop extra skb reference when HL TX fails

 drivers/net/wireless/ath/ath10k/htt_tx.c | 7 +++++++
 1 file changed, 7 insertions(+)


base-commit: aebb7274476403040d582c61478df8f4a7bf9cd3
-- 
2.43.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH ath-current v2 1/2] wifi: ath10k: free msdu_id when HL TX fails
  2026-11-19  0:28 [PATCH ath-current v2 0/2] wifi: ath10k: fix leaks when HL TX fails Changyul Lee
@ 2026-11-19  0:28 ` Changyul Lee
  2026-11-19  0:28 ` [PATCH ath-current v2 2/2] wifi: ath10k: drop extra skb reference " Changyul Lee
  1 sibling, 0 replies; 3+ messages in thread
From: Changyul Lee @ 2026-11-19  0:28 UTC (permalink / raw)
  To: Jeff Johnson, Loic Poulain
  Cc: linux-wireless, ath10k, linux-kernel, Changyul Lee

Free the msdu_id if ath10k_htc_send_hl() fails. Repeated failures can
otherwise exhaust the IDs and block further data transmissions.

Fixes: 8ea51e409eb0 ("ath10k: htt: support MSDU ids with SDIO")
Signed-off-by: Changyul Lee <lcy8047@gmail.com>
---
 drivers/net/wireless/ath/ath10k/htt_tx.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/net/wireless/ath/ath10k/htt_tx.c b/drivers/net/wireless/ath/ath10k/htt_tx.c
index efaea150025b..298e6a092101 100644
--- a/drivers/net/wireless/ath/ath10k/htt_tx.c
+++ b/drivers/net/wireless/ath/ath10k/htt_tx.c
@@ -1378,6 +1378,11 @@ static int ath10k_htt_tx_hl(struct ath10k_htt *htt, enum ath10k_hw_txrx_mode txm
 	tx_desc->peerid = __cpu_to_le32(HTT_INVALID_PEERID);
 
 	res = ath10k_htc_send_hl(&htt->ar->htc, htt->eid, msdu);
+	if (res && ar->bus_param.hl_msdu_ids) {
+		spin_lock_bh(&htt->tx_lock);
+		ath10k_htt_tx_free_msdu_id(htt, msdu_id);
+		spin_unlock_bh(&htt->tx_lock);
+	}
 
 out:
 	return res;
-- 
2.43.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH ath-current v2 2/2] wifi: ath10k: drop extra skb reference when HL TX fails
  2026-11-19  0:28 [PATCH ath-current v2 0/2] wifi: ath10k: fix leaks when HL TX fails Changyul Lee
  2026-11-19  0:28 ` [PATCH ath-current v2 1/2] wifi: ath10k: free msdu_id " Changyul Lee
@ 2026-11-19  0:28 ` Changyul Lee
  1 sibling, 0 replies; 3+ messages in thread
From: Changyul Lee @ 2026-11-19  0:28 UTC (permalink / raw)
  To: Jeff Johnson, Loic Poulain
  Cc: linux-wireless, ath10k, linux-kernel, Changyul Lee

If ath10k_htc_send_hl() fails, drop the reference taken by skb_get()
so the skb can be freed.

Fixes: 30382dd1cf3a ("ath10k: fix use-after-free on SDIO data frames")
Signed-off-by: Changyul Lee <lcy8047@gmail.com>
---
 drivers/net/wireless/ath/ath10k/htt_tx.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/net/wireless/ath/ath10k/htt_tx.c b/drivers/net/wireless/ath/ath10k/htt_tx.c
index 298e6a092101..7142dc1c4eb9 100644
--- a/drivers/net/wireless/ath/ath10k/htt_tx.c
+++ b/drivers/net/wireless/ath/ath10k/htt_tx.c
@@ -1383,6 +1383,8 @@ static int ath10k_htt_tx_hl(struct ath10k_htt *htt, enum ath10k_hw_txrx_mode txm
 		ath10k_htt_tx_free_msdu_id(htt, msdu_id);
 		spin_unlock_bh(&htt->tx_lock);
 	}
+	if (res)
+		dev_kfree_skb_any(msdu);
 
 out:
 	return res;
-- 
2.43.0


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-11-19  0:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-19  0:28 [PATCH ath-current v2 0/2] wifi: ath10k: fix leaks when HL TX fails Changyul Lee
2026-11-19  0:28 ` [PATCH ath-current v2 1/2] wifi: ath10k: free msdu_id " Changyul Lee
2026-11-19  0:28 ` [PATCH ath-current v2 2/2] wifi: ath10k: drop extra skb reference " Changyul Lee

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®