Răsfoiți Sursa

qcacld-3.0: Fix possible OOB in wma_unified_radio_tx_mem_free()

In wma_unified_radio_tx_mem_free() function, results buffer array may be
dereferenced with large index value, that may result OOB memory access.

Fix the same by correcting incrementing pointer to results buffer.

Change-Id: I57a26dba9db32758c7d7fd51b99d3364a8020a9d
CRs-Fixed: 2308644
Arif Hussain 6 ani în urmă
părinte
comite
6b0ed167ad
1 a modificat fișierele cu 1 adăugiri și 1 ștergeri
  1. 1 1
      core/wma/src/wma_utils.c

+ 1 - 1
core/wma/src/wma_utils.c

@@ -1411,7 +1411,6 @@ int wma_unified_radio_tx_mem_free(void *handle)
 	rs_results = (tSirWifiRadioStat *)
 				&wma_handle->link_stats_results->results[0];
 	for (i = 0; i < wma_handle->link_stats_results->num_radio; i++) {
-		rs_results += i;
 		if (rs_results->tx_time_per_power_level) {
 			qdf_mem_free(rs_results->tx_time_per_power_level);
 			rs_results->tx_time_per_power_level = NULL;
@@ -1421,6 +1420,7 @@ int wma_unified_radio_tx_mem_free(void *handle)
 			qdf_mem_free(rs_results->channels);
 			rs_results->channels = NULL;
 		}
+		rs_results++;
 	}
 
 	qdf_mem_free(wma_handle->link_stats_results);