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

Check for crash in do_ocall to prevent any data leakage. #138

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion sdk/trts/trts_ocall.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ extern "C" sgx_status_t __morestack(const unsigned int index, void *ms);
//
sgx_status_t sgx_ocall(const unsigned int index, void *ms)
{
// check for crash to prevent any data leakage
if(get_enclave_state() == ENCLAVE_CRASHED) {
return SGX_ERROR_ENCLAVE_CRASHED;
}
// sgx_ocall is not allowed during exception handling
thread_data_t *thread_data = get_thread_data();

Expand Down Expand Up @@ -138,4 +142,3 @@ sgx_status_t do_oret(void *ms)
// Should not come here
return SGX_ERROR_UNEXPECTED;
}