From f2cf6d18aa73fdaa916f95b1f3c5ac605a90ff06 Mon Sep 17 00:00:00 2001 From: yuyuany Date: Thu, 7 Sep 2017 15:21:45 +0800 Subject: [PATCH] Revert "Check for crash in sgx_ocall and exit enclave if enclave is crashed" --- sdk/trts/linux/trts_pic.S | 7 ------- sdk/trts/trts_ocall.cpp | 5 ----- 2 files changed, 12 deletions(-) diff --git a/sdk/trts/linux/trts_pic.S b/sdk/trts/linux/trts_pic.S index 57dcca151..9ce3bdd8e 100644 --- a/sdk/trts/linux/trts_pic.S +++ b/sdk/trts/linux/trts_pic.S @@ -190,13 +190,6 @@ DECLARE_GLOBAL_FUNC enclave_entry .cfi_endproc -DECLARE_GLOBAL_FUNC force_exit_enclave - READ_TD_DATA last_sp - sub $(2*SE_WORDSIZE), %xax - mov %xax, %xbp - mov $SGX_ERROR_ENCLAVE_CRASHED, %xbx - jmp .Lexit_enclave - /* * ------------------------------------------------------------------------- * sgx_status_t do_ocall(unsigned int index, void *ms); diff --git a/sdk/trts/trts_ocall.cpp b/sdk/trts/trts_ocall.cpp index ab82c705c..c1eebe08f 100644 --- a/sdk/trts/trts_ocall.cpp +++ b/sdk/trts/trts_ocall.cpp @@ -39,7 +39,6 @@ #include "xsave.h" #include "trts_internal.h" -extern "C" void force_exit_enclave(); extern "C" sgx_status_t asm_oret(uintptr_t sp, void *ms); extern "C" sgx_status_t __morestack(const unsigned int index, void *ms); #define do_ocall __morestack @@ -54,10 +53,6 @@ extern "C" sgx_status_t __morestack(const unsigned int index, void *ms); // sgx_status_t sgx_ocall(const unsigned int index, void *ms) { - if(get_enclave_state() == ENCLAVE_CRASHED) { - force_exit_enclave(); - } - // sgx_ocall is not allowed during exception handling thread_data_t *thread_data = get_thread_data();