mirror of
https://github.com/ARM-software/arm-trusted-firmware.git
synced 2025-04-16 09:34:18 +00:00
fix(el3-spmc): prevent total_page_count overflow
size_t is not guaranteed to be 64 bits, although it happens to be 64 bits on all systems that el3-spmc supports. Change-Id: Ieae11722a15448641de50233597ac35869eab574 Signed-off-by: Demi Marie Obenour <demiobenour@gmail.com>
This commit is contained in:
parent
a0f3b552cf
commit
2d4da8e265
1 changed files with 2 additions and 2 deletions
|
@ -799,7 +799,7 @@ static int spmc_shmem_check_obj(struct spmc_shmem_obj *obj,
|
|||
size_t size;
|
||||
size_t count;
|
||||
size_t expected_size;
|
||||
size_t total_page_count;
|
||||
uint64_t total_page_count;
|
||||
size_t emad_size;
|
||||
size_t header_emad_size;
|
||||
uint32_t offset;
|
||||
|
@ -894,7 +894,7 @@ static int spmc_shmem_check_obj(struct spmc_shmem_obj *obj,
|
|||
comp->address_range_array[i].page_count;
|
||||
}
|
||||
if (comp->total_page_count != total_page_count) {
|
||||
WARN("%s: invalid object, desc total_page_count %u != %zu\n",
|
||||
WARN("%s: invalid object, desc total_page_count %u != %" PRIu64 "\n",
|
||||
__func__, comp->total_page_count,
|
||||
total_page_count);
|
||||
return -EINVAL;
|
||||
|
|
Loading…
Add table
Reference in a new issue