Commit 053b4f92 authored by Chris Kay's avatar Chris Kay
Browse files

plat/arm: Fix incorrect bounds check in ARM_CASSERT_MMAP



The bounds check in ARM_CASSERT_MMAP does not take into account the
array sentinel in plat_arm_mmap. This commit fixes this, and adds an
additional check to ensure the number of entries in the array is
within the bounds of PLAT_ARM_MMAP_ENTRIES.

Change-Id: Ie6df10c0aa0890d62826bc3224ad7b3e36fd53e2
Signed-off-by: default avatarChris Kay <chris.kay@arm.com>
parent 3450fd62
...@@ -59,9 +59,11 @@ typedef struct arm_tzc_regions_info { ...@@ -59,9 +59,11 @@ typedef struct arm_tzc_regions_info {
PLAT_ARM_TZC_NS_DEV_ACCESS} PLAT_ARM_TZC_NS_DEV_ACCESS}
#endif #endif
#define ARM_CASSERT_MMAP \ #define ARM_CASSERT_MMAP \
CASSERT((ARRAY_SIZE(plat_arm_mmap) + ARM_BL_REGIONS) \ CASSERT((ARRAY_SIZE(plat_arm_mmap) - 1) <= PLAT_ARM_MMAP_ENTRIES, \
<= MAX_MMAP_REGIONS, \ assert_plat_arm_mmap_mismatch); \
CASSERT((PLAT_ARM_MMAP_ENTRIES + ARM_BL_REGIONS) \
<= MAX_MMAP_REGIONS, \
assert_max_mmap_regions); assert_max_mmap_regions);
/* /*
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment