aboutsummaryrefslogtreecommitdiff
path: root/secure_fw
diff options
context:
space:
mode:
authorShawn Shan <Shawn.Shan@arm.com>2021-05-17 15:28:02 +0800
committerKen Liu <ken.liu@arm.com>2021-05-31 05:21:45 +0200
commit9c7b9bec77d87a408f9d5594e429667c3c241e68 (patch)
tree386a7b375f71338b2852a5be56eef3bd0f5c4824 /secure_fw
parentcbaa22bfe88133591ed47fe08b9e95596795a24e (diff)
downloadtrusted-firmware-m-9c7b9bec77d87a408f9d5594e429667c3c241e68.tar.gz
SPM: Correct 'invalid parameter' error handling
- 'Invalid parameter' is regarded as 'programmer error' instead of return 'PSA_ERROR_INVALID_ARGUMENT'. - 'Programmer error' should be handled inside SPM instead of interface, as SPM needs to decide the error handling based on the caller attribute. - Keep the parameters range check inside the interface to give an explicit hint. - Correct 'type' casting to avoid lose sign bit. Change-Id: I35a5b70b5dc1ea7072c45f0ebac0630f65edfa00 Signed-off-by: Shawn Shan <Shawn.Shan@arm.com>
Diffstat (limited to 'secure_fw')
-rw-r--r--secure_fw/spm/ffm/psa_client_service_apis.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/secure_fw/spm/ffm/psa_client_service_apis.c b/secure_fw/spm/ffm/psa_client_service_apis.c
index 2f57c0cc8..57c1b82a4 100644
--- a/secure_fw/spm/ffm/psa_client_service_apis.c
+++ b/secure_fw/spm/ffm/psa_client_service_apis.c
@@ -78,7 +78,7 @@ psa_status_t tfm_spm_psa_call(uint32_t *args, bool ns_caller, uint32_t lr)
privileged = tfm_spm_partition_get_privileged_mode(
partition->p_static->flags);
- type = (int32_t)((args[1] & TYPE_MASK) >> TYPE_OFFSET);
+ type = (int32_t)(int16_t)((args[1] & TYPE_MASK) >> TYPE_OFFSET);
in_num = (size_t)((args[1] & IN_LEN_MASK) >> IN_LEN_OFFSET);
out_num = (size_t)((args[1] & OUT_LEN_MASK) >> OUT_LEN_OFFSET);
inptr = (psa_invec *)args[2];