diff options
author | Jens Wiklander <jens.wiklander@linaro.org> | 2020-08-13 16:42:17 +0200 |
---|---|---|
committer | Jérôme Forissier <jerome@forissier.org> | 2020-08-26 17:06:55 +0200 |
commit | 5e81752350d68e366bdc804201e27d15a8f3f0cf (patch) | |
tree | c66911be6366c350e345438be0909cd28d49528b /core/tee | |
parent | 2667e1359e516ed45b71b7857da750f531a8b16f (diff) |
core: syscall_storage_obj_create(): check that the attributes object is initialized
Adds a check in syscall_storage_obj_create() to see that the attributes
object is initialized.
Reviewed-by: Jerome Forissier <jerome@forissier.org>
Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Diffstat (limited to 'core/tee')
-rw-r--r-- | core/tee/tee_svc_storage.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/core/tee/tee_svc_storage.c b/core/tee/tee_svc_storage.c index 5602504a..d6418ec5 100644 --- a/core/tee/tee_svc_storage.c +++ b/core/tee/tee_svc_storage.c @@ -463,6 +463,11 @@ TEE_Result syscall_storage_obj_create(unsigned long storage_id, void *object_id, &attr_o); if (res != TEE_SUCCESS) goto err; + /* The supplied handle must be one of an initialized object */ + if (!(attr_o->info.handleFlags & TEE_HANDLE_FLAG_INITIALIZED)) { + res = TEE_ERROR_BAD_PARAMETERS; + goto err; + } } res = tee_svc_storage_init_file(o, attr_o, data, len); |