mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
haven: hh_rm_iface: Avoid integer overflow for multiplication
Add a check to ensure that overflow does not happen in multiplication operation. Change-Id: I28ea55c760257775c1bec3fdfb373fe075190cab Signed-off-by: Naman Jain <[email protected]> Signed-off-by: Kishor Krishna Bhat <[email protected]>
This commit is contained in:
parent
d6a2023cd2
commit
501d0efe75
1 changed files with 2 additions and 0 deletions
|
|
@ -121,6 +121,8 @@ hh_rm_vm_get_hyp_res(hh_vmid_t vmid, u32 *n_entries)
|
|||
|
||||
/* The response payload should contain all the resource entries */
|
||||
if (resp_payload_size < sizeof(*n_entries) ||
|
||||
(sizeof(*resp_entries) &&
|
||||
(resp_payload->n_resource_entries > U32_MAX / sizeof(*resp_entries))) ||
|
||||
(sizeof(*n_entries) > (U32_MAX -
|
||||
(resp_payload->n_resource_entries * sizeof(*resp_entries)))) ||
|
||||
resp_payload_size != sizeof(*n_entries) +
|
||||
|
|
|
|||
Loading…
Reference in a new issue