Home
last modified time | relevance | path

Searched hist:b81882b289e70aa571b387f2b54aea853d74b31e (Results 1 – 1 of 1) sorted by relevance

/optee_os/core/tee/
H A Dtee_svc_storage.cb81882b289e70aa571b387f2b54aea853d74b31e Tue Sep 13 09:37:46 UTC 2016 Jerome Forissier <jerome.forissier@linaro.org> 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 file1) | Thread 2 (delete file2)
|
| unlink("/TA_dir/file2");
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 <jerome.forissier@linaro.org>
Reviewed-by: Jens Wiklander <jens.wiklander@linaro.org>