From: Changyul Lee <lcy8047@gmail.com>
To: Jeff Johnson <jjohnson@kernel.org>,
Loic Poulain <loic.poulain@oss.qualcomm.com>
Cc: Wentao Liang <vulab@iscas.ac.cn>,
linux-wireless@vger.kernel.org, ath10k@lists.infradead.org,
linux-kernel@vger.kernel.org, Changyul Lee <lcy8047@gmail.com>
Subject: [PATCH ath-next] wifi: ath10k: free msdu_id and skb reference when HL TX fails
Date: Wed, 18 Nov 2026 00:21:16 -0500 [thread overview]
Message-ID: <20261118052116.3901761-1-lcy8047@gmail.com> (raw)
For SDIO and USB devices, ath10k_htt_tx_hl() allocates an msdu_id in
htt->pending_tx and takes an extra skb reference that
ath10k_htt_htc_tx_complete() normally drops. If ath10k_htc_send_hl()
fails, for example because the endpoint has no TX credits and TX
bundling is off, no completion runs and both are leaked. After
max_num_pending_tx such failures, msdu_id allocation fails and no more
data frames can be sent.
Free the msdu_id under tx_lock, as ath10k_htt_tx_32() does on its error
path, and drop the extra skb reference.
Fixes: 8ea51e409eb0 ("ath10k: htt: support MSDU ids with SDIO")
Fixes: 30382dd1cf3a ("ath10k: fix use-after-free on SDIO data frames")
Signed-off-by: Changyul Lee <lcy8047@gmail.com>
---
Found with a static analysis tool we are developing.
Compile-tested only, with x86_64_defconfig plus ATH10K_SDIO, ATH10K_USB
and W=1.
drivers/net/wireless/ath/ath10k/htt_tx.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/net/wireless/ath/ath10k/htt_tx.c b/drivers/net/wireless/ath/ath10k/htt_tx.c
index efaea150025b..b437b09717e1 100644
--- a/drivers/net/wireless/ath/ath10k/htt_tx.c
+++ b/drivers/net/wireless/ath/ath10k/htt_tx.c
@@ -1378,6 +1378,14 @@ 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) {
+ if (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);
+ }
+ dev_kfree_skb_any(msdu);
+ }
out:
return res;
base-commit: 4016f6c3149e7e3faccc1654db6a3030c069383a
--
2.43.0
next reply other threads:[~2026-11-18 5:21 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-18 5:21 Changyul Lee [this message]
2026-11-18 8:53 ` Loic Poulain
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261118052116.3901761-1-lcy8047@gmail.com \
--to=lcy8047@gmail.com \
--cc=ath10k@lists.infradead.org \
--cc=jjohnson@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=loic.poulain@oss.qualcomm.com \
--cc=vulab@iscas.ac.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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®