Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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: b86c18e ("core: RPMB FS: prepare for new FOP interface") Fixes: OP-TEE/optee_os#1332 Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org> Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>
- Loading branch information