Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
storage: protect TA directory with a mutex
There is a race condition in the code that creates and deletes trusted storage. If multiple threads invoke a multi-session TA to create and delete different files (such as xtest 6016), the following can occur: Thread #1 (create file #1) | Thread #2 (delete file #2) | | remove("/TA_dir/file"); mkdir("/TA_dir"); | | rmdir("/TA_dir"); create("/TA_dir/file1"); | => ENOENT | Add a mutex to prevent this race condition. Note: the bug is currently not triggered by xtest 1016 because the test is run for RPMB FS only, and because directory operations are no-ops in the RPMB implementation. The fix will be needed when enabling single-TA concurrency with the REE and SQL backends. Signed-off-by: Jerome Forissier <[email protected]>
- Loading branch information