fix(ff-a): check parameters of FFA_MSG_WAIT
Calling FFA_MSG_WAIT with non-zero values should return
INVALID_PARAMETERS as far as SPM is concerned. Usage of these
parameters for passing timeout values through ERET is out of scope as
it only concerns Hypervisor.
In addition to the check the Hafnium test has been added to check for
that.
Signed-off-by: Maksims Svecovs <maksims.svecovs@arm.com>
Change-Id: Ia223de947ea5d24bdc71a09a3cd733a28485c050
diff --git a/src/arch/aarch64/hypervisor/handler.c b/src/arch/aarch64/hypervisor/handler.c
index 06f675c..0b4550d 100644
--- a/src/arch/aarch64/hypervisor/handler.c
+++ b/src/arch/aarch64/hypervisor/handler.c
@@ -521,6 +521,12 @@
current, next);
return true;
case FFA_MSG_WAIT_32:
+ if (args->arg1 != 0U || args->arg2 != 0U || args->arg3 != 0U ||
+ args->arg4 != 0U || args->arg5 != 0U || args->arg6 != 0U ||
+ args->arg7 != 0U) {
+ *args = ffa_error(FFA_INVALID_PARAMETERS);
+ return true;
+ }
#if SECURE_WORLD == 1
if (sp_boot_next(current, next, args)) {
return true;