]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
wifi: wcn36xx: fix heap overflow from oversized firmware HAL response
authorTristan Madani <tristan@talencesecurity.com>
Tue, 21 Apr 2026 13:50:16 +0000 (13:50 +0000)
committerJeff Johnson <jeff.johnson@oss.qualcomm.com>
Sat, 6 Jun 2026 15:46:27 +0000 (08:46 -0700)
The firmware response dispatcher copies all synchronous HAL responses
into the 4096-byte hal_buf without validating the response length. A
response exceeding WCN36XX_HAL_BUF_SIZE causes a heap buffer overflow
with firmware-controlled content.

Add a bounds check on the response length.

Fixes: 8e84c2582169 ("wcn36xx: mac80211 driver for Qualcomm WCN3660/WCN3680 hardware")
Signed-off-by: Tristan Madani <tristan@talencesecurity.com>
Reviewed-by: Loic Poulain <loic.poulain@oss.qualcomm.com>
Link: https://patch.msgid.link/20260421135018.352774-2-tristmd@gmail.com
Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
drivers/net/wireless/ath/wcn36xx/smd.c

index 813553edcb78996f21421c52b5429b1cd1733db5..f65328329f4f08f878c5b60d2a6ac1d01663f61f 100644 (file)
@@ -3293,6 +3293,10 @@ int wcn36xx_smd_rsp_process(struct rpmsg_device *rpdev,
        case WCN36XX_HAL_EXIT_IMPS_RSP:
        case WCN36XX_HAL_UPDATE_CHANNEL_LIST_RSP:
        case WCN36XX_HAL_ADD_BCN_FILTER_RSP:
+               if (len > WCN36XX_HAL_BUF_SIZE) {
+                       wcn36xx_warn("HAL response too large: %d\n", len);
+                       break;
+               }
                memcpy(wcn->hal_buf, buf, len);
                wcn->hal_rsp_len = len;
                complete(&wcn->hal_rsp_compl);