]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - optee/ti-optee-client.git/commit
tee-supplicant: REE fs open file with O_SYNC flag 2.6.0 2.6.0-rc1 ti2017.05 ti2017.05-rc4 ti2017.06 ti2017.06-rc1 ti2017.06-rc2 ti2017.06-rc3 ti2017.06-rc4
authorl00176142 <l00176142@notesmail.huawei.com.cn>
Mon, 16 Oct 2017 09:05:45 +0000 (17:05 +0800)
committerJérôme Forissier <jerome.forissier@linaro.org>
Mon, 16 Oct 2017 07:46:42 +0000 (09:46 +0200)
commit73b4e490a8ed0b4a7714818e80998b9d8a7da958
tree362f2df6bb1dc5e85bc7a9f8de1ba881aea0297a
parent075c56eebdc96ec304264da04ff45c0ee3acc3d9
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>
tee-supplicant/src/tee_supp_fs.c