Home
last modified time | relevance | path

Searched hist:"928468 cbdbbee58dcbbf736f2eb258aa5431950f" (Results 1 – 1 of 1) sorted by relevance

/optee_os/core/tee/
H A Dtee_svc_storage.c928468cbdbbee58dcbbf736f2eb258aa5431950f Thu Feb 02 15:47:51 UTC 2017 Jerome Forissier <jerome.forissier@linaro.org> core: RPMB FS: nullify fops when resetting an enumerator

According to the GP spec, TEE_ResetPersistentObjectEnumerator() "resets
an object enumerator handle to its initial state after allocation".
Therefore, syscall_storage_reset_enum() should set e->fops = NULL.

This fixes a regression introduced when the FOP interface was reworked.
I'm not simply reverting the return code from TEE_ERROR_GENERIC back to
TEE_ERROR_ITEM_NOT_FOUND, because the new code makes sense and it is
more sane to properly reset the state of the enumerator.

Consequently, tee_svc_close_enum() is updated to accept e->fops == NULL
which is valid when the enum has just been allocated or reset but not
started. We should not return an error status in this case.

Tested on HiKey using xtest with GP tests (all 3 filesystems: REE, SQL,
RPMB).

Fixes: b86c18ecc7d3 ("core: RPMB FS: prepare for new FOP interface")
Fixes: https://github.com/OP-TEE/optee_os/issues/1332
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>