Skip to content

Commit 16e0adb

Browse files
Sarika Sharmaopsiff
authored andcommitted
wifi: ath12k: fix invalid access to memory
mainline inclusion from mainline-v6.15-rc3 category: bugfix CVE: CVE-2025-38292 In ath12k_dp_rx_msdu_coalesce(), rxcb is fetched from skb and boolean is_continuation is part of rxcb. Currently, after freeing the skb, the rxcb->is_continuation accessed again which is wrong since the memory is already freed. This might lead use-after-free error. Hence, fix by locally defining bool is_continuation from rxcb, so that after freeing skb, is_continuation can be used. Compile tested only. Fixes: d889913 ("wifi: ath12k: driver for Qualcomm Wi-Fi 7 devices") Signed-off-by: Sarika Sharma <quic_sarishar@quicinc.com> Reviewed-by: Vasanthakumar Thiagarajan <vasanthakumar.thiagarajan@oss.qualcomm.com> Link: https://patch.msgid.link/20250408045327.1632222-1-quic_sarishar@quicinc.com Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com> (cherry picked from commit 9f17747) Signed-off-by: Wentao Guan <guanwentao@uniontech.com> Conflicts: drivers/net/wireless/ath/ath12k/dp_rx.c
1 parent 12cd73c commit 16e0adb

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

  • drivers/net/wireless/ath/ath12k

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1783,6 +1783,7 @@ static int ath12k_dp_rx_msdu_coalesce(struct ath12k *ar,
17831783
struct hal_rx_desc *ldesc;
17841784
int space_extra, rem_len, buf_len;
17851785
u32 hal_rx_desc_sz = ar->ab->hw_params->hal_desc_sz;
1786+
bool is_continuation;
17861787

17871788
/* As the msdu is spread across multiple rx buffers,
17881789
* find the offset to the start of msdu for computing
@@ -1831,7 +1832,8 @@ static int ath12k_dp_rx_msdu_coalesce(struct ath12k *ar,
18311832
rem_len = msdu_len - buf_first_len;
18321833
while ((skb = __skb_dequeue(msdu_list)) != NULL && rem_len > 0) {
18331834
rxcb = ATH12K_SKB_RXCB(skb);
1834-
if (rxcb->is_continuation)
1835+
is_continuation = rxcb->is_continuation;
1836+
if (is_continuation)
18351837
buf_len = DP_RX_BUFFER_SIZE - hal_rx_desc_sz;
18361838
else
18371839
buf_len = rem_len;
@@ -1849,7 +1851,7 @@ static int ath12k_dp_rx_msdu_coalesce(struct ath12k *ar,
18491851
dev_kfree_skb_any(skb);
18501852

18511853
rem_len -= buf_len;
1852-
if (!rxcb->is_continuation)
1854+
if (!is_continuation)
18531855
break;
18541856
}
18551857

0 commit comments

Comments
 (0)