Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move inject_entropy_with_timestamp() inside mutex protected sections #594

Closed
wants to merge 1 commit into from
Closed

Conversation

pascal-brand38
Copy link
Contributor

inject_entropy_with_timestamp() is used to change the
entropy of the RNG each time we call tee_dispatch_open_session /
tee_dispatch_close_session. This is performed outside of a
session context, and outside mutex protection.
inject_entropy_with_timestamp() calls RPC to get the REE time.
When freing the shared memory in case of concurrent TA, we may
have a race condition between optee_os and the supplicant
when accessing / freeing the shared memory.

This patch calls inject_entropy_with_timestamp() inside the
mutex protected section, when calling tee_ta_init_session().

Signed-off-by: Pascal Brand [email protected]

inject_entropy_with_timestamp() is used to change the
entropy of the RNG each time we call tee_dispatch_open_session /
tee_dispatch_close_session. This is performed outside of a
session context, and outside mutex protection.
inject_entropy_with_timestamp() calls RPC to get the REE time.
When freing the shared memory in case of concurrent TA, we may
have a race condition between optee_os and the supplicant
when accessing / freeing the shared memory.

This patch calls inject_entropy_with_timestamp() inside the
mutex protected section, when calling tee_ta_init_session().

Signed-off-by: Pascal Brand <[email protected]>
@pascal-brand38 pascal-brand38 mentioned this pull request Dec 16, 2015
@jenswi-linaro
Copy link
Contributor

In tee_time_get_ree_time() alloc and free is done in the same thread, I don't see the race.

@pascal-brand38
Copy link
Contributor Author

Right. Correct fix is OP-TEE/optee_linuxdriver#37

@pascal-brand38 pascal-brand38 deleted the entropy branch April 25, 2016 10:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants