Linux wireless drivers development
 help / color / mirror / Atom feed
* [PATCH] wifi: ath11k: fix use after free in ath11k_dp_rx_msdu_coalesce.
@ 2026-05-05 14:30 Willmar Knikker
  2026-05-05 15:08 ` Jeff Johnson
  2026-05-05 15:13 ` Jeff Johnson
  0 siblings, 2 replies; 5+ messages in thread
From: Willmar Knikker @ 2026-05-05 14:30 UTC (permalink / raw)
  To: jjohnson; +Cc: linux-wireless, ath11k

In ath11k_dp_rx_msdu_coalesce the loop uses ->is_continuation after
the dev_kfree_skb_any. This can cause a use after free kfence.

Move the use after the dev_kfree_skb_any after use of ->is_continuation
inline with the while in the while loop above this one.

Signed-off-by: Willmar Knikker <willmar@met-dubbel-l.nl>
---
 drivers/net/wireless/ath/ath11k/dp_rx.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/net/wireless/ath/ath11k/dp_rx.c b/drivers/net/wireless/ath/ath11k/dp_rx.c
index fe79109adc70..02bd9787d6b4 100644
--- a/drivers/net/wireless/ath/ath11k/dp_rx.c
+++ b/drivers/net/wireless/ath/ath11k/dp_rx.c
@@ -1825,11 +1825,12 @@ static int ath11k_dp_rx_msdu_coalesce(struct ath11k *ar,
 		skb_pull(skb, hal_rx_desc_sz);
 		skb_copy_from_linear_data(skb, skb_put(first, buf_len),
 					  buf_len);
-		dev_kfree_skb_any(skb);
-
 		rem_len -= buf_len;
-		if (!rxcb->is_continuation)
+		if (!rxcb->is_continuation) {
+			dev_kfree_skb_any(skb);
 			break;
+		}
+		dev_kfree_skb_any(skb);
 	}
 
 	return 0;
-- 
2.54.0



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

end of thread, other threads:[~2026-05-05 16:54 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-05 14:30 [PATCH] wifi: ath11k: fix use after free in ath11k_dp_rx_msdu_coalesce Willmar Knikker
2026-05-05 15:08 ` Jeff Johnson
2026-05-05 16:38   ` Rameshkumar Sundaram
2026-05-05 16:53   ` Willmar Knikker
2026-05-05 15:13 ` Jeff Johnson

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