We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d257c20 commit 34f5d59Copy full SHA for 34f5d59
src/libstd/sys/sgx/abi/entry.S
@@ -119,16 +119,11 @@ sgx_entry:
119
mov %rbx,%gs:tcsls_tcs_addr
120
stmxcsr %gs:tcsls_user_mxcsr
121
fnstcw %gs:tcsls_user_fcw
122
-/* reset user state */
123
- cld /* x86-64 ABI requires DF to be unset at function entry/exit */
124
125
-/* making sure AC flag is not set in rflags */
126
-/* avoid using the 'clac' instruction to be compatible with older compilers */
127
- pushfq
128
- popq %rcx
129
- and $0xFFFFFFFFFFFBFFFF, %rcx
130
- push %rcx
131
- popfq
+/* reset user state */
+/* - DF flag: x86-64 ABI requires DF to be unset at function entry/exit */
+/* - AC flag: AEX on misaligned memory accesses leaks side channel info */
+ andq $~0x40400, (%rsp)
132
133
/* check for debug buffer pointer */
134
testb $0xff,DEBUG(%rip)
0 commit comments