fix(lib/realm): convert assertions to proper checks
The functions `addr_is_contained()` and `region_is_contained()`
had assertions to validate the sanity of input arguments. But it was
noticed that in some cases, it was possible for this sanity to be
violated at runtime, thus triggering the assertion.
One such instance is in `smc_realm_create()` where it was noticed
that the arguments `rtt_base` and `rtt_base + rtt_num_start * GRANULE_SIZE`
can overflow and violate the sanity of the arguments passed to
`addr_is_contained()`.
Hence this patch converts these assertions to runtime checks to
ensure that we check the arguments without assuming sanity at runtime.
Signed-off-by:
Soby Mathew <soby.mathew@arm.com>
Change-Id: I6433d65250f42787092a63a8a6e50d7fcb425dd2
Loading
Please register or sign in to comment