Skip to content
Snippets Groups Projects
Commit 67434972 authored by Dennis Cagle's avatar Dennis Cagle Committed by Thierry Strudel
Browse files

qcacld-2.0: Add sanity check to avoid overflow in WMI event data


In WMA, data from firmware event buffer is used without
sanity checks for upper limit. This might lead to a potential
integer overflow further leading to buffer corruption.

Add sanity check to avoid integer overflow.

Change-Id: Id47e12015a4d46af24180b621b52ffcb17596c07
CRs-Fixed: 2113919
Bug: 68992426
Signed-off-by: default avatarDennis Cagle <d-cagle@codeaurora.org>
parent 8018564f
No related branches found
No related tags found
No related merge requests found
......@@ -5264,6 +5264,14 @@ static int wma_unified_power_debug_stats_event_handler(void *handle,
return -EINVAL;
}
 
if (param_buf->num_debug_register > ((WMA_SVC_MSG_MAX_SIZE -
sizeof(wmi_pdev_chip_power_stats_event_fixed_param)) /
sizeof(uint32_t))) {
WMA_LOGE("excess payload: LEN num_debug_register:%u",
param_buf->num_debug_register);
return -EINVAL;
}
debug_registers = param_tlvs->debug_registers;
stats_registers_len =
(sizeof(uint32_t) * param_buf->num_debug_register);
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment