diff --git a/Pal/src/host/Linux-SGX/enclave_entry.S b/Pal/src/host/Linux-SGX/enclave_entry.S index ea23bb18..abeb7050 100644 --- a/Pal/src/host/Linux-SGX/enclave_entry.S +++ b/Pal/src/host/Linux-SGX/enclave_entry.S @@ -230,6 +230,9 @@ enclave_entry: andq $STACK_ALIGN, %rsi movq %rsi, SGX_GPR_RSP(%rbx) + # clear rflags to conform the ABI which requires RFLAGS.DF = 0 + movq $0, SGX_GPR_RFLAGS(%rbx) + # new RIP is the exception handler leaq _DkExceptionHandler(%rip), %rdi movq %rdi, SGX_GPR_RIP(%rbx)