]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
wifi: wcn36xx: fix OOB read from short trigger BA firmware response
authorTristan Madani <tristan@talencesecurity.com>
Tue, 21 Apr 2026 13:50:18 +0000 (13:50 +0000)
committerJeff Johnson <jeff.johnson@oss.qualcomm.com>
Sat, 6 Jun 2026 15:46:28 +0000 (08:46 -0700)
The firmware response length is only checked against sizeof(*rsp) (20
bytes), but when candidate_cnt >= 1, a 22-byte candidate struct is read
at buf + 20 without verifying the response contains it. This causes an
out-of-bounds read of stale heap data, corrupting the BA session state.

Add validation that the response includes the candidate data.

Fixes: 16be1ac55944 ("wcn36xx: Parse trigger_ba response properly")
Signed-off-by: Tristan Madani <tristan@talencesecurity.com>
Reviewed-by: Loic Poulain <loic.poulain@oss.qualcomm.com>
Link: https://patch.msgid.link/20260421135018.352774-4-tristmd@gmail.com
Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
drivers/net/wireless/ath/wcn36xx/smd.c

index 2a0c946d81095070c3b9b3ec33552aee75dc402c..c0b477345832b828f772d68a503b27ef4bf4f07c 100644 (file)
@@ -2599,6 +2599,9 @@ static int wcn36xx_smd_trigger_ba_rsp(void *buf, int len, struct add_ba_info *ba
        if (rsp->candidate_cnt < 1)
                return rsp->status ? rsp->status : -EINVAL;
 
+       if (len < sizeof(*rsp) + sizeof(*candidate))
+               return -EINVAL;
+
        candidate = (struct wcn36xx_hal_trigger_ba_rsp_candidate *)(buf + sizeof(*rsp));
 
        for (i = 0; i < STACFG_MAX_TC; i++) {