Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[PAL/Linux-SGX] Read exitless-OCALL result before resetting the stack
Previously, there was a data race that the exitless-OCALL logic read the result of the OCALL from the stack *after* the code reset the stack. However, this stack is shared with the AEX flows. As of now, the AEX flows use the stack only in debug mode, so this data race flew under the radar for a long time. What can happen is that right-before reading the result of the exitless OCALL, the enclave thread is interrupted, an AEX logic is executed and modifies the values on the stack, then the exitless-OCALL logic is resumed, and the enclave thread reads an AEX-modified OCALL result value. Future commits (e.g., AEX-Notify) will introduce more AEX flows and expose this data race. So let's fix it now. Signed-off-by: Dmitrii Kuvaiskii <dmitrii.kuvaiskii@intel.com>
- Loading branch information