Browse Source

[Pal/Linux-SGX] Remove unnecessary check on exit_target

exit_target is only used as an argument to EEXIT to tell the processor
where to continue execution after leaving enclave mode. As documented in
the Intel SDM: If it points to enclave memory it will be restored but
the access will happen after leaving enclave mode so the usual enclave
protections are enforced. Therefore the software check is unnecessary.

Also size == 0 didn't make much sense.
Simon Gaiser 6 years ago
parent
commit
7ae7ba7832
1 changed files with 0 additions and 3 deletions
  1. 0 3
      Pal/src/host/Linux-SGX/enclave_ecalls.c

+ 0 - 3
Pal/src/host/Linux-SGX/enclave_ecalls.c

@@ -30,9 +30,6 @@ void handle_ecall (long ecall_index, void * ecall_args, void * exit_target,
         enclave_top = enclave_base_addr + GET_ENCLAVE_TLS(enclave_size);
     }
 
-    if (sgx_is_within_enclave(exit_target, 0))
-        return;
-
     if (sgx_is_within_enclave(untrusted_stack, 0))
         return;