Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions tests/run-make/x86_64-fortanix-unknown-sgx-lvi/print.checks
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
CHECK: print
CHECK: lfence
CHECK: lfence
CHECK: lfence
CHECK: callq 0x{{[[:xdigit:]]*}} <_Unwind_Resume>
CHECK-NEXT: ud2
CHECK: popq
CHECK-NEXT: popq [[REGISTER:%[a-z]+]]
CHECK-NEXT: lfence
CHECK-NEXT: jmpq *[[REGISTER]]
9 changes: 9 additions & 0 deletions tests/run-make/x86_64-fortanix-unknown-sgx-lvi/script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,15 @@ function check {
${objdump} --disassemble-symbols="${func}" --demangle \
${enclave} > ${asm}
${filecheck} --input-file ${asm} ${checks}

if [ "${func_re}" != "rust_plus_one_global_asm" &&
"${func_re}" != "cmake_plus_one_c_global_asm" ]; then
# The assembler cannot avoid explicit `ret` instructions. Sequences
# of `shlq $0x0, (%rsp); lfence; retq` are used instead.
# https://www.intel.com/content/www/us/en/developer/articles/technical/
# software-security-guidance/technical-documentation/load-value-injection.html
${filecheck} --implicit-check-not ret --input-file ${asm} ${checks}
fi
}

build
Expand Down