mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH ath-next 0/2] wifi: ath11k/ath12k: fix a double free when the first fragment's descriptor copy fails
@ 2026-10-30 18:07 Adriel Santos
  2026-10-30 18:07 ` [PATCH ath-next 1/2] wifi: ath11k: copy the first fragment's descriptor before queuing it Adriel Santos
  2026-10-30 18:07 ` [PATCH ath-next 2/2] wifi: ath12k: " Adriel Santos
  0 siblings, 2 replies; 3+ messages in thread
From: Adriel Santos @ 2026-10-30 18:07 UTC (permalink / raw)
  To: Jeff Johnson; +Cc: linux-wireless, ath11k, ath12k, linux-kernel

In both drivers, the RX defragmentation path queues fragment 0 before it
copies the fragment's REO destination descriptor. If that GFP_ATOMIC copy
fails, the caller frees the skb while it is still queued, which leads to a
double free or a use after free plus a NULL dereference on reinjection.
Both patches move the copy before the queueing.

Patch 1 was tested on IPQ5018 on an OpenWrt backports tree, with forced
allocation failures (details in its notes); patch 2 is compile tested
only.

Both bugs were found during an LLM-assisted review of the RX fragment
handling, and an LLM coding assistant also helped write the patches and
run the bench tests described in patch 1's notes. I reviewed the
analysis, the code and the test results, and I am responsible for both
patches.

Adriel Santos (2):
  wifi: ath11k: copy the first fragment's descriptor before queuing it
  wifi: ath12k: copy the first fragment's descriptor before queuing it

 drivers/net/wireless/ath/ath11k/dp_rx.c       | 22 ++++++++++---------
 drivers/net/wireless/ath/ath12k/wifi7/dp_rx.c | 22 ++++++++++---------
 2 files changed, 24 insertions(+), 20 deletions(-)

-- 
2.47.3


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

end of thread, other threads:[~2026-10-30 18:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-30 18:07 [PATCH ath-next 0/2] wifi: ath11k/ath12k: fix a double free when the first fragment's descriptor copy fails Adriel Santos
2026-10-30 18:07 ` [PATCH ath-next 1/2] wifi: ath11k: copy the first fragment's descriptor before queuing it Adriel Santos
2026-10-30 18:07 ` [PATCH ath-next 2/2] wifi: ath12k: " Adriel Santos

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®