Skip to content

Commit b35f243

Browse files
committed
Verify that (almost) all ret instructions have been replaced
1 parent 62c8c7c commit b35f243

File tree

1 file changed

+9
-0
lines changed
  • tests/run-make/x86_64-fortanix-unknown-sgx-lvi

1 file changed

+9
-0
lines changed

tests/run-make/x86_64-fortanix-unknown-sgx-lvi/script.sh

+9
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,15 @@ function check {
3333
${objdump} --disassemble-symbols="${func}" --demangle \
3434
${enclave} > ${asm}
3535
${filecheck} --input-file ${asm} ${checks}
36+
37+
if [ "${func_re}" != "rust_plus_one_global_asm" &&
38+
"${func_re}" != "cmake_plus_one_c_global_asm" ]; then
39+
# The assembler cannot avoid explicit `ret` instructions. Sequences
40+
# of `shlq $0x0, (%rsp); lfence; retq` are used instead.
41+
# https://www.intel.com/content/www/us/en/developer/articles/technical/
42+
# software-security-guidance/technical-documentation/load-value-injection.html
43+
${filecheck} --implicit-check-not ret --input-file ${asm} ${checks}
44+
fi
3645
}
3746

3847
build

0 commit comments

Comments
 (0)