ath10k: fix array out-of-bounds access
If firmware reports rate_max > WMI_TPC_RATE_MAX(WMI_TPC_FINAL_RATE_MAX) or num_tx_chain > WMI_TPC_TX_N_CHAIN, it will cause array out-of-bounds access, so print a warning and reset to avoid memory corruption. Tested HW: QCA9984 Tested FW: 10.4-3.9.0.2-00035 Signed-off-by: Miaoqing Pan <miaoqing@codeaurora.org> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
This commit is contained in:
@@ -1516,7 +1516,7 @@ static void ath10k_tpc_stats_print(struct ath10k_tpc_stats *tpc_stats,
|
||||
*len += scnprintf(buf + *len, buf_len - *len,
|
||||
"No. Preamble Rate_code ");
|
||||
|
||||
for (i = 0; i < WMI_TPC_TX_N_CHAIN; i++)
|
||||
for (i = 0; i < tpc_stats->num_tx_chain; i++)
|
||||
*len += scnprintf(buf + *len, buf_len - *len,
|
||||
"tpc_value%d ", i);
|
||||
|
||||
|
Reference in New Issue
Block a user