From 8ca26cca2919977cba79e7436c4f72fb6661ea9b Mon Sep 17 00:00:00 2001 From: Raoul Strackx Date: Fri, 27 Mar 2020 16:46:52 +0100 Subject: [PATCH] Building libunwind with new CMakeLists. The old CMakeLists file of libunwind used the C compiler to compile assembly files. This caused such code not to be hardened. --- ...6_64-fortanix-unknown-sgx-lvi-module-level-assembly.rs | 4 ---- .../run-make/x86_64-fortanix-unknown-sgx-lvi/script.sh | 8 ++------ .../x86_64-fortanix-unknown-sgx-lvi/unw_getcontext.checks | 3 +-- 3 files changed, 3 insertions(+), 12 deletions(-) diff --git a/src/test/assembly/x86_64-fortanix-unknown-sgx-lvi-module-level-assembly.rs b/src/test/assembly/x86_64-fortanix-unknown-sgx-lvi-module-level-assembly.rs index 6b7e7b7767c6..b8dc747d3b4c 100644 --- a/src/test/assembly/x86_64-fortanix-unknown-sgx-lvi-module-level-assembly.rs +++ b/src/test/assembly/x86_64-fortanix-unknown-sgx-lvi-module-level-assembly.rs @@ -10,7 +10,3 @@ global_asm!(".start_module_asm: movq (%rdi), %rax retq .end_module_asm:" ); - -// CHECK: .start_module_asm -// TODO add check, when module-level pass is corrected -// CHECK: .end_module_asm diff --git a/src/test/run-make/x86_64-fortanix-unknown-sgx-lvi/script.sh b/src/test/run-make/x86_64-fortanix-unknown-sgx-lvi/script.sh index 9f151b34c917..ee6dc33feae6 100644 --- a/src/test/run-make/x86_64-fortanix-unknown-sgx-lvi/script.sh +++ b/src/test/run-make/x86_64-fortanix-unknown-sgx-lvi/script.sh @@ -31,12 +31,8 @@ function check { build -#TODO: re-enable check when newly compiled libunwind is used -#check unw_getcontext unw_getcontext.checks - -#TODO: re-enable check when newly compiled libunwind is used -#check "libunwind::Registers_x86_64::jumpto()" jumpto.checks - +check unw_getcontext unw_getcontext.checks +check "libunwind::Registers_x86_64::jumpto()" jumpto.checks check "std::io::stdio::_print::h87f0c238421c45bc" print.checks check rust_plus_one_global_asm rust_plus_one_global_asm.checks || echo "warning: module level assembly currently not hardened" diff --git a/src/test/run-make/x86_64-fortanix-unknown-sgx-lvi/unw_getcontext.checks b/src/test/run-make/x86_64-fortanix-unknown-sgx-lvi/unw_getcontext.checks index 50b828662e35..4b7615b115dc 100644 --- a/src/test/run-make/x86_64-fortanix-unknown-sgx-lvi/unw_getcontext.checks +++ b/src/test/run-make/x86_64-fortanix-unknown-sgx-lvi/unw_getcontext.checks @@ -1,7 +1,6 @@ CHECK: unw_getcontext CHECK: lfence CHECK: lfence -CHECK: notq (%rsp) -CHECK-NEXT: notq (%rsp) +CHECK: shlq $0, (%rsp) CHECK-NEXT: lfence CHECK-NEXT: retq