]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
wifi: ath12k: fix possible out-of-bound write in ath12k_wmi_ext_hal_reg_caps()
authorBaochen Qiang <quic_bqiang@quicinc.com>
Wed, 20 Sep 2023 13:43:42 +0000 (16:43 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 28 Nov 2023 17:14:42 +0000 (17:14 +0000)
commitdfe13eaab043130f90dd3d57c7d88577c04adc97
tree8a2d758048b568df09743bd02a289cc0f3355f8f
parent0b8e7c1169a6d1e16aec1304f487259a245bdae0
wifi: ath12k: fix possible out-of-bound write in ath12k_wmi_ext_hal_reg_caps()

[ Upstream commit b302dce3d9edea5b93d1902a541684a967f3c63c ]

reg_cap.phy_id is extracted from WMI event and could be an unexpected value
in case some errors happen. As a result out-of-bound write may occur to
soc->hal_reg_cap. Fix it by validating reg_cap.phy_id before using it.

This is found during code review.

Compile tested only.

Signed-off-by: Baochen Qiang <quic_bqiang@quicinc.com>
Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
Link: https://lore.kernel.org/r/20230830020716.5420-1-quic_bqiang@quicinc.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/wireless/ath/ath12k/wmi.c