summaryrefslogtreecommitdiff
path: root/core/tee/tee_pobj.c
diff options
context:
space:
mode:
authorJens Wiklander <jens.wiklander@linaro.org>2020-08-18 14:26:05 +0200
committerJérôme Forissier <jerome@forissier.org>2020-08-26 17:16:11 +0200
commit928efd065222491b7c6255e3ec98aab18dc9925a (patch)
tree3216894a7ff96400dd65dd41b1ecbeb2cb809c1f /core/tee/tee_pobj.c
parent6885abf2f7ef758b0a9c5f3580af167a53ec28dd (diff)
core: syscall_storage_next_enum() use live pobj
Instead of using a fake pobj in syscall_storage_next_enum() retrieve the shared pobj instead in order to get the flags of an already opened object. TEE_POBJ_USAGE_ENUM is supplied to tee_pobj_get() to avoid checking for conflicts with how the pobj is already used. Reviewed-by: Jerome Forissier <jerome@forissier.org> Signed-off-by: Jens Wiklander <jens.wiklander@linaro.org>
Diffstat (limited to 'core/tee/tee_pobj.c')
-rw-r--r--core/tee/tee_pobj.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/core/tee/tee_pobj.c b/core/tee/tee_pobj.c
index 14e96f62..57aea7c0 100644
--- a/core/tee/tee_pobj.c
+++ b/core/tee/tee_pobj.c
@@ -80,6 +80,10 @@ TEE_Result tee_pobj_get(TEE_UUID *uuid, void *obj_id, uint32_t obj_id_len,
}
if (*obj) {
+ if (usage == TEE_POBJ_USAGE_ENUM) {
+ (*obj)->refcnt++;
+ goto out;
+ }
if (temporary != (*obj)->temporary) {
res = TEE_ERROR_ACCESS_CONFLICT;
goto out;