From da01e3411fcf8010f4ae581946cf4b0e7753e024 Mon Sep 17 00:00:00 2001 From: Michael Schwarcz Date: Thu, 7 Feb 2019 12:14:41 +0200 Subject: [PATCH] TF-M patch: Fix tfm_psa_call_venner wrong argument type (TF-M issue #241) - Link to bug tracking: https://developer.trustedfirmware.org/T241 --- .../COMPONENT_SPE/secure_fw/core/tfm_psa_api_client.c | 5 +++-- components/TARGET_PSA/TARGET_TFM/interface/include/tfm_api.h | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/components/TARGET_PSA/TARGET_TFM/COMPONENT_SPE/secure_fw/core/tfm_psa_api_client.c b/components/TARGET_PSA/TARGET_TFM/COMPONENT_SPE/secure_fw/core/tfm_psa_api_client.c index 4b35c58e7f..36f2c16358 100644 --- a/components/TARGET_PSA/TARGET_TFM/COMPONENT_SPE/secure_fw/core/tfm_psa_api_client.c +++ b/components/TARGET_PSA/TARGET_TFM/COMPONENT_SPE/secure_fw/core/tfm_psa_api_client.c @@ -48,7 +48,8 @@ int32_t tfm_core_ns_ipc_request(void *fn, int32_t arg1, int32_t arg2, int32_t arg3, int32_t arg4) { int32_t args[4] = {arg1, arg2, arg3, arg4}; - struct tfm_sfn_req_s desc, *desc_ptr = &desc; + volatile struct tfm_sfn_req_s desc; + struct tfm_sfn_req_s *desc_ptr = &desc; int32_t res; desc.sfn = fn; @@ -98,7 +99,7 @@ psa_handle_t tfm_psa_connect_veneer(uint32_t sid, uint32_t minor_version) __tfm_secure_gateway_attributes__ psa_status_t tfm_psa_call_veneer(psa_handle_t handle, const psa_invec *in_vecs, - const psa_invec *out_vecs) + psa_outvec *out_vecs) { TFM_CORE_NS_IPC_REQUEST_VENEER(tfm_svcall_psa_call, handle, in_vecs, out_vecs, 0); diff --git a/components/TARGET_PSA/TARGET_TFM/interface/include/tfm_api.h b/components/TARGET_PSA/TARGET_TFM/interface/include/tfm_api.h index 7656908fa4..79a94cbdd0 100644 --- a/components/TARGET_PSA/TARGET_TFM/interface/include/tfm_api.h +++ b/components/TARGET_PSA/TARGET_TFM/interface/include/tfm_api.h @@ -105,13 +105,13 @@ psa_handle_t tfm_psa_connect_veneer(uint32_t sid, uint32_t minor_version); * * \param[in] handle Handle to connection * \param[in] in_vecs invec containing pointer/count of input vectors - * \param[in] out_vecs invec containing pointer/count of output vectors + * \param[in] out_vecs outvec containing pointer/count of output vectors * * \return Returns \ref psa_status_t status code */ psa_status_t tfm_psa_call_veneer(psa_handle_t handle, const psa_invec *in_vecs, - const psa_invec *out_vecs); + psa_outvec *out_vecs); /** * \brief Close connection to secure function referenced by a connection handle