aboutsummaryrefslogtreecommitdiff
path: root/core/tee
diff options
context:
space:
mode:
authorJerome Forissier <jerome.forissier@linaro.org>2018-12-18 15:36:50 +0100
committerJérôme Forissier <jerome.forissier@linaro.org>2018-12-19 12:22:11 +0100
commitb1183340a491fe968f3747df77459521bfae5819 (patch)
tree167eb04a2fb41c2ec2ad42b3821acc5fbcb46d3a /core/tee
parentb148ed09330bcb7ad6274286c1b88d709afa90bd (diff)
core: syscall_storage_obj_rename(): fix handling of .rename() return status
Any error returned by fops->rename() should be reflected by syscall_storage_obj_rename(). There is no reason why errors other than TEE_ERROR_GENERIC should be ignored. Fixes the following test case: create two persistent objects (o1 and o2), close o1, rename o2 to the name of o1. TEE_RenamePersistentObject() should return TEE_ERROR_ACCESS_CONFLICT, but TEE_SUCCESS is returned instead. Fixes: https://github.com/OP-TEE/optee_os/issues/2707 Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reported-by: Chao Liu <chao.liu@amlogic.com> Reviewed-by: Joakim Bech <joakim.bech@linaro.org> Acked-by: Jens Wiklander <jens.wiklander@linaro.org>
Diffstat (limited to 'core/tee')
-rw-r--r--core/tee/tee_svc_storage.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/tee/tee_svc_storage.c b/core/tee/tee_svc_storage.c
index a95543c7..5025a065 100644
--- a/core/tee/tee_svc_storage.c
+++ b/core/tee/tee_svc_storage.c
@@ -569,7 +569,7 @@ TEE_Result syscall_storage_obj_rename(unsigned long obj, void *object_id,
/* move */
res = fops->rename(o->pobj, po, false /* no overwrite */);
- if (res == TEE_ERROR_GENERIC)
+ if (res)
goto exit;
res = tee_pobj_rename(o->pobj, object_id, object_id_len);