From: Jiale Yao The ready event reports the number of extra MAC addresses separately from the fixed-structure address array. ath11k checks the reported count before assigning addresses to radios, but does not check the length of the array TLV. A truncated array therefore causes reads past the supplied event data. Validate the array capacity before copying any addresses. Fixes: d5c65159f289 ("ath11k: driver for Qualcomm IEEE 802.11ax devices") Signed-off-by: Jiale Yao --- drivers/net/wireless/ath/ath11k/wmi.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/wireless/ath/ath11k/wmi.c b/drivers/net/wireless/ath/ath11k/wmi.c index 995fee2ffdfa..9a048c7d9858 100644 --- a/drivers/net/wireless/ath/ath11k/wmi.c +++ b/drivers/net/wireless/ath/ath11k/wmi.c @@ -7328,6 +7328,9 @@ static int ath11k_wmi_tlv_rdy_parse(struct ath11k_base *ab, u16 tag, u16 len, if (!(ab->num_radios > 1 && num_mac_addr >= ab->num_radios)) break; + if (len / sizeof(*addr_list) < ab->num_radios) + return -EINVAL; + for (i = 0; i < ab->num_radios; i++) { pdev = &ab->pdevs[i]; ether_addr_copy(pdev->mac_addr, addr_list[i].addr); -- 2.34.1