Skip to content
Commit 2fe0763a authored by Soby Mathew's avatar Soby Mathew
Browse files

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's avatarSoby Mathew <soby.mathew@arm.com>
Change-Id: I6433d65250f42787092a63a8a6e50d7fcb425dd2
parent 0e2bf779
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment