mirror of
https://github.com/ARM-software/arm-trusted-firmware.git
synced 2025-04-16 09:34:18 +00:00
fix(el3-spmc): validate shmem descriptor alignment
If the size of a shmem descriptor is not a multiple of 16, the descriptor would be unusable, but the problem would be caught much later. Change-Id: I907f3862b55c6341e39a6b8b2e24784127230478 Signed-off-by: Demi Marie Obenour <demiobenour@gmail.com>
This commit is contained in:
parent
91567c3843
commit
dd94372d77
1 changed files with 7 additions and 0 deletions
|
@ -80,6 +80,13 @@ spmc_shmem_obj_alloc(struct spmc_shmem_obj_state *state, size_t desc_size)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
/* Ensure that descriptor size is aligned */
|
||||
if (!is_aligned(desc_size, 16)) {
|
||||
WARN("%s(0x%zx) desc_size not 16-byte aligned\n",
|
||||
__func__, desc_size);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
obj_size = spmc_shmem_obj_size(desc_size);
|
||||
|
||||
/* Ensure the obj size has not overflowed. */
|
||||
|
|
Loading…
Add table
Reference in a new issue