Skip to content

Commit 64228df

Browse files
Tristan Madanigregkh
authored andcommitted
wifi: wcn36xx: fix OOB read from firmware count in PRINT_REG_INFO indication
[ Upstream commit df2187a ] The firmware-controlled rsp->count field is used as the loop bound for indexing into the flexible rsp->regs[] array without validation against the message length. A count exceeding the actual data causes out-of- bounds reads from the heap-allocated message buffer. Add a check that count fits within the received message. Fixes: 43efa3c ("wcn36xx: Implement print_reg indication") Signed-off-by: Tristan Madani <tristan@talencesecurity.com> Reviewed-by: Loic Poulain <loic.poulain@oss.qualcomm.com> Link: https://patch.msgid.link/20260421135018.352774-3-tristmd@gmail.com Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent cfc67ae commit 64228df

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

  • drivers/net/wireless/ath/wcn36xx

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2865,6 +2865,12 @@ static int wcn36xx_smd_print_reg_info_ind(struct wcn36xx *wcn,
28652865
return -EIO;
28662866
}
28672867

2868+
if (rsp->count > (len - sizeof(*rsp)) / sizeof(rsp->regs[0])) {
2869+
wcn36xx_warn("Truncated print reg info indication: count %u, len %zu\n",
2870+
rsp->count, len);
2871+
return -EIO;
2872+
}
2873+
28682874
wcn36xx_dbg(WCN36XX_DBG_HAL,
28692875
"reginfo indication, scenario: 0x%x reason: 0x%x\n",
28702876
rsp->scenario, rsp->reason);

0 commit comments

Comments
 (0)