-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
core: reset cancellation mask on TA entry #6694
Conversation
My email adress is [email protected] |
By the way, I see that the optee_os/core/kernel/user_ta.c Line 230 in 897aaf1
At first glance, I would tell that the setting of cancel_mask and cancel should probably be done around the same location.
Also, now that I think of it, although |
Yes, that makes sense.
I assume you mean to set
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo in commit message?
- ... the TA cancellation was mask only reset when ...
+ ... the TA cancellation mask was only reset when ...
Acked-by: Etienne Carriere <[email protected]>
for the implmentation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed-by: Jerome Forissier <[email protected]>
Resetting the Are you OK with replacing it all with "core: reset cancellation mask on TA exit" instead? |
I think that indeed we should not reset That said, when we were implementing our TEE using your frontend on non secure world, we spotted something that seemed strange to us, and is somehow out of the scope of this issue, so I will try to make it short.
Then I suspect but did not test (so I might be completely wrong about that) it that the invoke command will be cancelled, because you do not seem to track the operations themselves. Otherwise stated, I think that you cancel sessions and not operations. Now to go back to the issue, yes, the sessions state should be reset after processing the operation, so that the next operation will start on a cleaned state. Maybe that it would be easier to follow the logic if you create a |
Yes, we're currently canceling the current operation on a session rather than a specific operation. The ABI is defined to use a cancel_id in the current session, but we have never implemented that. That may change the day it becomes a problem. If you're still using optee_client feel free to assign a cancel ID unique for the TEEC_Operation in the session. |
This pull request has been marked as a stale pull request because it has been open (more than) 30 days with no activity. Remove the stale label or add a comment, otherwise this pull request will automatically be closed in 5 days. Note, that you can always re-open a closed issue at any time. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very straightforward, LGTM. One minor comment re. the commit descriptions:
fix this by resetting the cancellation mask each time a TA exits.
"each time the TA returns" maybe? "Exits" sounds like it will not be entered again.
ce64f90
to
fa1336c
Compare
Commit message updated and tag applied. |
Before this patch, the TA cancellation mask was only reset when the session was created, but the GP spec requires the cancellation mask to be reset each time a TA is entered via one of its entry points. So fix this by resetting the cancellation mask each time a TA returns. Link: OP-TEE/optee_test#731 Fixes: b010477 ("Open-source the TEE Core") Signed-off-by: Jens Wiklander <[email protected]> Acked-by: Etienne Carriere <[email protected]> Reviewed-by: Jerome Forissier <[email protected]>
fa1336c
to
04be187
Compare
I'm sorry, I forgot to squash the earlier commits and add Etienne's A-B, I've done that now. |
Before this patch, the TA cancellation mask was only reset when the session was created, but the GP spec requires the cancellation mask to be reset each time a TA is entered via one of its entry points. So fix this by resetting the cancellation mask at the same time as when setting the cancellation request timeout.
Link: OP-TEE/optee_test#731
Fixes: b010477 ("Open-source the TEE Core")
Depends on OP-TEE/optee_test#732
@bvalliere @c-auger please provide your email addresses if you want a
Reported-by:
tag for this patch.