commit | 32167a076c1b6bfa2b8274f0ec8a27251ffbd2fd | [log] [tgz] |
---|---|---|
author | Demi Marie Obenour <demiobenour@gmail.com> | Wed Jan 11 10:51:01 2023 -0500 |
committer | Demi Marie Obenour <demiobenour@gmail.com> | Wed May 03 10:39:53 2023 -0400 |
tree | d4669120c77ffb82adceb29b17ac7443376ad6fb | |
parent | 57bf10cc59edd4adebf8a754d89c199f03619396 [diff] |
refactor(spmc): assert on out-of-bounds emad access This always indicates a bug. Change-Id: Ie0d5d4c84d9fb615ba6cdf0e6d46eab778fc7e94 Signed-off-by: Demi Marie Obenour <demiobenour@gmail.com>
diff --git a/services/std_svc/spm/el3_spmc/spmc_shared_mem.c b/services/std_svc/spm/el3_spmc/spmc_shared_mem.c index 1e00982..6cc6b7d 100644 --- a/services/std_svc/spm/el3_spmc/spmc_shared_mem.c +++ b/services/std_svc/spm/el3_spmc/spmc_shared_mem.c
@@ -196,6 +196,9 @@ uint32_t ffa_version, size_t *emad_size) { uint8_t *emad; + + assert(index < desc->emad_count); + /* * If the caller is using FF-A v1.0 interpret the descriptor as a v1.0 * format, otherwise assume it is a v1.1 format.