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
author | l00176142 <l00176142@notesmail.huawei.com.cn> | |
Mon, 16 Oct 2017 09:05:45 +0000 (17:05 +0800) | ||
committer | Jérôme Forissier <jerome.forissier@linaro.org> | |
Mon, 16 Oct 2017 07:46:42 +0000 (09:46 +0200) | ||
commit | 73b4e490a8ed0b4a7714818e80998b9d8a7da958 | |
tree | 362f2df6bb1dc5e85bc7a9f8de1ba881aea0297a | tree | snapshot (tar.xz tar.gz zip) |
parent | 075c56eebdc96ec304264da04ff45c0ee3acc3d9 | commit | diff |
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>
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 | diff | blob | history |