Skip to content

Commit

Permalink
Prevent attacker from manipulating FPU tag word used in SGX enclave
Browse files Browse the repository at this point in the history
Insufficient sanitization of the x87 FPU tag word in the trusted enclave runtime allowed unprivileged adversaries in the containing host application to induce incoherent or unexpected results for ABI-compliant compiled enclave application code that uses the x87 FPU.

Vulnerability was disclosed to us by Fritz Alder, Jo Van Bulck, David Oswald and Frank Piessens
  • Loading branch information
raoulstrackx committed Jun 18, 2020
1 parent e55d3f9 commit daedb79
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/libstd/sys/sgx/abi/entry.S
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,13 @@ sgx_entry:
jz .Lskip_debug_init
mov %r10,%gs:tcsls_debug_panic_buf_ptr
.Lskip_debug_init:
/* reset cpu state */
mov %rdx, %r10
mov $-1, %rax
mov $-1, %rdx
xrstor .Lxsave_clear(%rip)
mov %r10, %rdx

/* check if returning from usercall */
mov %gs:tcsls_last_rsp,%r11
test %r11,%r11
Expand Down

0 comments on commit daedb79

Please sign in to comment.