wifi: ath12k: fix possible out-of-bound read in ath12k_htt_pull_ppdu_stats()
authorBaochen Qiang <quic_bqiang@quicinc.com>
Fri, 1 Sep 2023 01:56:02 +0000 (09:56 +0800)
committerKalle Valo <quic_kvalo@quicinc.com>
Wed, 20 Sep 2023 13:38:10 +0000 (16:38 +0300)
commit1bc44a505a229bb1dd4957e11aa594edeea3690e
tree551aa7c0101ff685fd86d126ad7d8898737c4d7a
parent41e7a399aea1dbf3d0ffdeb6ef8e9eaea7fa6cf5
wifi: ath12k: fix possible out-of-bound read in ath12k_htt_pull_ppdu_stats()

len is extracted from HTT message and could be an unexpected value in
case errors happen, so add validation before using to avoid possible
out-of-bound read in the following message iteration and parsing.

The same issue also applies to ppdu_info->ppdu_stats.common.num_users,
so validate it before using too.

These are found during code review.

Compile test 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/20230901015602.45112-1-quic_bqiang@quicinc.com
drivers/net/wireless/ath/ath12k/dp_rx.c