aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--secure_fw/core/ipc/tfm_svcalls.c20
-rw-r--r--secure_fw/core/tfm_secure_api.c2
-rw-r--r--secure_fw/core/tfm_secure_api.h2
-rw-r--r--secure_fw/spm/spm_api.h2
-rw-r--r--secure_fw/spm/spm_api_ipc.c2
5 files changed, 14 insertions, 14 deletions
diff --git a/secure_fw/core/ipc/tfm_svcalls.c b/secure_fw/core/ipc/tfm_svcalls.c
index e507057486..a5f32390de 100644
--- a/secure_fw/core/ipc/tfm_svcalls.c
+++ b/secure_fw/core/ipc/tfm_svcalls.c
@@ -186,11 +186,11 @@ psa_status_t tfm_svcall_psa_call(uint32_t *args, int32_t ns_caller, uint32_t lr)
* Read parameters from the arguments. It is a fatal error if the
* memory reference for buffer is invalid or not readable.
*/
- if (tfm_memory_check((void *)args[2], sizeof(uint32_t),
+ if (tfm_memory_check((const void *)args[2], sizeof(uint32_t),
ns_caller, TFM_MEMORY_ACCESS_RO, privileged) != IPC_SUCCESS) {
tfm_panic();
}
- if (tfm_memory_check((void *)args[3], sizeof(uint32_t),
+ if (tfm_memory_check((const void *)args[3], sizeof(uint32_t),
ns_caller, TFM_MEMORY_ACCESS_RO, privileged) != IPC_SUCCESS) {
tfm_panic();
}
@@ -218,8 +218,8 @@ psa_status_t tfm_svcall_psa_call(uint32_t *args, int32_t ns_caller, uint32_t lr)
* if the memory reference for the wrap input vector is invalid or not
* readable.
*/
- if (tfm_memory_check((void *)inptr, in_num * sizeof(psa_invec),
- ns_caller, TFM_MEMORY_ACCESS_RO, privileged) != IPC_SUCCESS) {
+ if (tfm_memory_check(inptr, in_num * sizeof(psa_invec), ns_caller,
+ TFM_MEMORY_ACCESS_RO, privileged) != IPC_SUCCESS) {
tfm_panic();
}
/*
@@ -227,8 +227,8 @@ psa_status_t tfm_svcall_psa_call(uint32_t *args, int32_t ns_caller, uint32_t lr)
* actual length later. It is a fatal error if the memory reference for
* the wrap output vector is invalid or not read-write.
*/
- if (tfm_memory_check((void *)outptr, out_num * sizeof(psa_outvec),
- ns_caller, TFM_MEMORY_ACCESS_RW, privileged) != IPC_SUCCESS) {
+ if (tfm_memory_check(outptr, out_num * sizeof(psa_outvec), ns_caller,
+ TFM_MEMORY_ACCESS_RW, privileged) != IPC_SUCCESS) {
tfm_panic();
}
@@ -244,8 +244,8 @@ psa_status_t tfm_svcall_psa_call(uint32_t *args, int32_t ns_caller, uint32_t lr)
* memory reference was invalid or not readable.
*/
for (i = 0; i < in_num; i++) {
- if (tfm_memory_check((void *)invecs[i].base, invecs[i].len,
- ns_caller, TFM_MEMORY_ACCESS_RO, privileged) != IPC_SUCCESS) {
+ if (tfm_memory_check(invecs[i].base, invecs[i].len, ns_caller,
+ TFM_MEMORY_ACCESS_RO, privileged) != IPC_SUCCESS) {
tfm_panic();
}
}
@@ -423,8 +423,8 @@ static psa_status_t tfm_svcall_psa_get(uint32_t *args)
* Write the message to the service buffer. It is a fatal error if the
* input msg pointer is not a valid memory reference or not read-write.
*/
- if (tfm_memory_check((void *)msg, sizeof(psa_msg_t),
- false, TFM_MEMORY_ACCESS_RW, privileged) != IPC_SUCCESS) {
+ if (tfm_memory_check(msg, sizeof(psa_msg_t), false, TFM_MEMORY_ACCESS_RW,
+ privileged) != IPC_SUCCESS) {
tfm_panic();
}
diff --git a/secure_fw/core/tfm_secure_api.c b/secure_fw/core/tfm_secure_api.c
index 3a262d42f0..6555fcb86b 100644
--- a/secure_fw/core/tfm_secure_api.c
+++ b/secure_fw/core/tfm_secure_api.c
@@ -166,7 +166,7 @@ enum tfm_status_e tfm_core_has_read_access_to_region(const void *p, size_t s,
return has_access_to_region(p, s, flags);
}
-enum tfm_status_e tfm_core_has_write_access_to_region(void *p, size_t s,
+enum tfm_status_e tfm_core_has_write_access_to_region(const void *p, size_t s,
uint32_t ns_caller,
uint32_t privileged)
{
diff --git a/secure_fw/core/tfm_secure_api.h b/secure_fw/core/tfm_secure_api.h
index 69828f0693..c626df1371 100644
--- a/secure_fw/core/tfm_secure_api.h
+++ b/secure_fw/core/tfm_secure_api.h
@@ -126,7 +126,7 @@ enum tfm_status_e tfm_core_has_read_access_to_region(const void *p, size_t s,
* \return TFM_SUCCESS if the partition has access to the memory range,
* TFM_ERROR_GENERIC otherwise.
*/
-enum tfm_status_e tfm_core_has_write_access_to_region(void *p, size_t s,
+enum tfm_status_e tfm_core_has_write_access_to_region(const void *p, size_t s,
uint32_t ns_caller,
uint32_t privileged);
diff --git a/secure_fw/spm/spm_api.h b/secure_fw/spm/spm_api.h
index 7f95339c0f..02c5dbf1b6 100644
--- a/secure_fw/spm/spm_api.h
+++ b/secure_fw/spm/spm_api.h
@@ -638,7 +638,7 @@ int32_t tfm_spm_check_client_version(struct tfm_spm_service_t *service,
* \retval IPC_ERROR_BAD_PARAMETERS Bad parameters input
* \retval IPC_ERROR_MEMORY_CHECK Check failed
*/
-int32_t tfm_memory_check(void *buffer, size_t len, int32_t ns_caller,
+int32_t tfm_memory_check(const void *buffer, size_t len, int32_t ns_caller,
enum tfm_memory_access_e access,
uint32_t privileged);
diff --git a/secure_fw/spm/spm_api_ipc.c b/secure_fw/spm/spm_api_ipc.c
index 98f6046cbb..24fd179a97 100644
--- a/secure_fw/spm/spm_api_ipc.c
+++ b/secure_fw/spm/spm_api_ipc.c
@@ -450,7 +450,7 @@ static uint32_t tfm_spm_partition_get_priority(uint32_t partition_idx)
partition_priority;
}
-int32_t tfm_memory_check(void *buffer, size_t len, int32_t ns_caller,
+int32_t tfm_memory_check(const void *buffer, size_t len, int32_t ns_caller,
enum tfm_memory_access_e access,
uint32_t privileged)
{