about summary refs log tree commit diff
path: root/tests
diff options
context:
space:
mode:
authorRaoul Strackx <raoul.strackx@fortanix.com>2023-06-05 15:10:03 +0200
committerRaoul Strackx <raoul.strackx@fortanix.com>2023-06-05 17:33:26 +0200
commitb35f243c89907ba86b55fac5f86f591f7f342cde (patch)
tree0af58b9bdbcdacf868b2d4106c1924f3e5c5e0b6 /tests
parent62c8c7cca8f4e8133878c6e42ebb3c4236b3e7ff (diff)
downloadrust-b35f243c89907ba86b55fac5f86f591f7f342cde.tar.gz
rust-b35f243c89907ba86b55fac5f86f591f7f342cde.zip
Verify that (almost) all `ret` instructions have been replaced
Diffstat (limited to 'tests')
-rw-r--r--tests/run-make/x86_64-fortanix-unknown-sgx-lvi/script.sh9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/run-make/x86_64-fortanix-unknown-sgx-lvi/script.sh b/tests/run-make/x86_64-fortanix-unknown-sgx-lvi/script.sh
index 235bb603b84..04a34724518 100644
--- a/tests/run-make/x86_64-fortanix-unknown-sgx-lvi/script.sh
+++ b/tests/run-make/x86_64-fortanix-unknown-sgx-lvi/script.sh
@@ -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