Skip to content

Commit 4d8af93

Browse files
miaoqing-quicjeff-t-johnson
authored andcommitted
wifi: ath11k: add MSDU length validation for TKIP MIC error
In the WBM error path, while processing TKIP MIC errors, MSDU length is fetched from the hal_rx_desc's msdu_end. This MSDU length is directly passed to skb_put() without validation. In stress test scenarios, the WBM error ring may receive invalid descriptors, which could lead to an invalid MSDU length. To fix this, add a check to drop the skb when the calculated MSDU length is greater than the skb size. This is adapted from the discussion/patch of the ath12k driver [1]. Tested-on: WCN6855 hw2.1 PCI WLAN.HSP.1.1-04685-QCAHSPSWPL_V1_V2_SILICONZ_IOE-1 Link: https://lore.kernel.org/linux-wireless/20250416021903.3178962-1-nithyanantham.paramasivam@oss.qualcomm.com/ # [1] Signed-off-by: Miaoqing Pan <miaoqing.pan@oss.qualcomm.com> Reviewed-by: Rameshkumar Sundaram <rameshkumar.sundaram@oss.qualcomm.com> Reviewed-by: Baochen Qiang <baochen.qiang@oss.qualcomm.com> Link: https://patch.msgid.link/20260512022351.2033155-3-miaoqing.pan@oss.qualcomm.com Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
1 parent 6b471e9 commit 4d8af93

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

  • drivers/net/wireless/ath/ath11k

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4051,6 +4051,15 @@ static bool ath11k_dp_rx_h_tkip_mic_err(struct ath11k *ar, struct sk_buff *msdu,
40514051

40524052
l3pad_bytes = ath11k_dp_rx_h_msdu_end_l3pad(ar->ab, desc);
40534053
msdu_len = ath11k_dp_rx_h_msdu_start_msdu_len(ar->ab, desc);
4054+
4055+
if (unlikely(hal_rx_desc_sz + l3pad_bytes + msdu_len > DP_RX_BUFFER_SIZE)) {
4056+
ath11k_dbg(ab, ATH11K_DBG_DATA,
4057+
"invalid msdu len in tkip mic err %u\n", msdu_len);
4058+
ath11k_dbg_dump(ab, ATH11K_DBG_DATA, NULL, "", desc,
4059+
sizeof(*desc));
4060+
return true;
4061+
}
4062+
40544063
skb_put(msdu, hal_rx_desc_sz + l3pad_bytes + msdu_len);
40554064
skb_pull(msdu, hal_rx_desc_sz + l3pad_bytes);
40564065

0 commit comments

Comments
 (0)