Skip to content

Commit 72b8654

Browse files
DrNotThatEviljeff-t-johnson
authored andcommitted
wifi: ath11k: fix use after free in ath11k_dp_rx_msdu_coalesce()
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. Use flag for caching is_continuation for use after the dev_kfree_skb_any(). Fixes: d5c6515 ("ath11k: driver for Qualcomm IEEE 802.11ax devices") Signed-off-by: Willmar Knikker <willmar@met-dubbel-l.nl> Reviewed-by: Baochen Qiang <baochen.qiang@oss.qualcomm.com> Reviewed-by: Rameshkumar Sundaram <rameshkumar.sundaram@oss.qualcomm.com> Link: https://patch.msgid.link/20260505171709.547274-1-willmar@met-dubbel-l.nl Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
1 parent 2a2451a commit 72b8654

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

  • drivers/net/wireless/ath/ath11k

drivers/net/wireless/ath/ath11k/dp_rx.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1761,6 +1761,7 @@ static int ath11k_dp_rx_msdu_coalesce(struct ath11k *ar,
17611761
int buf_first_hdr_len, buf_first_len;
17621762
struct hal_rx_desc *ldesc;
17631763
int space_extra, rem_len, buf_len;
1764+
bool is_continuation;
17641765
u32 hal_rx_desc_sz = ar->ab->hw_params.hal_desc_sz;
17651766

17661767
/* As the msdu is spread across multiple rx buffers,
@@ -1810,7 +1811,8 @@ static int ath11k_dp_rx_msdu_coalesce(struct ath11k *ar,
18101811
rem_len = msdu_len - buf_first_len;
18111812
while ((skb = __skb_dequeue(msdu_list)) != NULL && rem_len > 0) {
18121813
rxcb = ATH11K_SKB_RXCB(skb);
1813-
if (rxcb->is_continuation)
1814+
is_continuation = rxcb->is_continuation;
1815+
if (is_continuation)
18141816
buf_len = DP_RX_BUFFER_SIZE - hal_rx_desc_sz;
18151817
else
18161818
buf_len = rem_len;
@@ -1828,7 +1830,7 @@ static int ath11k_dp_rx_msdu_coalesce(struct ath11k *ar,
18281830
dev_kfree_skb_any(skb);
18291831

18301832
rem_len -= buf_len;
1831-
if (!rxcb->is_continuation)
1833+
if (!is_continuation)
18321834
break;
18331835
}
18341836

0 commit comments

Comments
 (0)