tee-supplicant: REE fs open file with O_SYNC flag
CFG_RPMB_FS=y and RPMB_EMU=0(use EMMC RPMB device). Power down when writing file without the O_SYNC flag, dirf.db was cached by kernel, some very old (more than two generations) version was in the file system. If dirf.db and dirfile.db.hash (residing in RPMB) differ by two versions, it will cause TEE_ERROR_SECURITY, and the file data will lost. Add O_SYNC flag in open file to fix this issue. (fixed by Jens Wiklander) Signed-off-by:Jianhui Li <airbak.li@hisilicon.com> Tested-by: Jianhui Li <airbak.li@hisilicon.com> (Hisilicon) Reviewed-by:
Jens Wiklander <jens.wiklander@linaro.org>
Loading
Please register or sign in to comment