Skip to content

Commit

Permalink
core: reset cancellation mask on TA exit
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
jenswi-linaro authored and jforissier committed Mar 28, 2024
1 parent 021a43d commit a471cde
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion core/kernel/user_ta.c
Original file line number Diff line number Diff line change
Expand Up @@ -223,11 +223,12 @@ static TEE_Result user_ta_enter(struct ts_session *session,
dec_recursion();
out_clr_cancel:
/*
* Clear the cancel state now that the user TA has returned. The next
* Reset the cancel state now that the user TA has returned. The next
* time the TA will be invoked will be with a new operation and should
* not have an old cancellation pending.
*/
ta_sess->cancel = false;
ta_sess->cancel_mask = true;

return res;
}
Expand Down

0 comments on commit a471cde

Please sign in to comment.