Skip to content

Commit d0b57bc

Browse files
Tristan Madanigregkh
authored andcommitted
wifi: wcn36xx: fix OOB read from short trigger BA firmware response
[ Upstream commit b5e6f21 ] 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: 16be1ac ("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> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 23d2108 commit d0b57bc

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

  • drivers/net/wireless/ath/wcn36xx

drivers/net/wireless/ath/wcn36xx/smd.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2659,6 +2659,9 @@ static int wcn36xx_smd_trigger_ba_rsp(void *buf, int len, struct add_ba_info *ba
26592659
if (rsp->candidate_cnt < 1)
26602660
return rsp->status ? rsp->status : -EINVAL;
26612661

2662+
if (len < sizeof(*rsp) + sizeof(*candidate))
2663+
return -EINVAL;
2664+
26622665
candidate = (struct wcn36xx_hal_trigger_ba_rsp_candidate *)(buf + sizeof(*rsp));
26632666

26642667
for (i = 0; i < STACFG_MAX_TC; i++) {

0 commit comments

Comments
 (0)