mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-15 01:01:56 -04:00
qcacld-3.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: 2112832
This commit is contained in:
parent
cc7c927f9f
commit
2f931531b0
1 changed files with 7 additions and 0 deletions
|
|
@ -5224,6 +5224,13 @@ int wma_unified_power_debug_stats_event_handler(void *handle,
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (param_buf->num_debug_register > ((WMI_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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue