From d60fcada6d02174dbae8f7b686413431e954a5ef Mon Sep 17 00:00:00 2001 From: Etienne Carriere Date: Tue, 7 Nov 2017 22:53:27 +0100 Subject: [PATCH] core: fix access conflict status in rpmb fs that panics TA According to the GPD TEE Internal Core API specs, when creating an existing persistent object without the overwrite flag, the OS should return a TEE_ERROR_ACCESS_CONFLICT status. This change fixes the RPMB FS layer. An effect of this correction is that before this change, OS panicked TAs that requested such forbidden object creation, as a TEE_ERROR_BAD_PARAMETERS return value is considered by the API as an unexpected status. Signed-off-by: Etienne Carriere --- core/tee/tee_rpmb_fs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/tee/tee_rpmb_fs.c b/core/tee/tee_rpmb_fs.c index 2658658845f..862a4f65063 100644 --- a/core/tee/tee_rpmb_fs.c +++ b/core/tee/tee_rpmb_fs.c @@ -2251,7 +2251,7 @@ static TEE_Result rpmb_fs_rename_internal(struct tee_pobj *old, res = read_fat(fh_new, NULL); if (res == TEE_SUCCESS) { if (!overwrite) { - res = TEE_ERROR_BAD_PARAMETERS; + res = TEE_ERROR_ACCESS_CONFLICT; goto out; }