diff --git a/tools/selective_cfi/scfi_instr.cpp b/tools/selective_cfi/scfi_instr.cpp index caaed2f1ef03f6de388bbf9b0b05628bb4dd0d2f..198fb0b0d5e0af196f44edf6a4154cb8e0adff5f 100644 --- a/tools/selective_cfi/scfi_instr.cpp +++ b/tools/selective_cfi/scfi_instr.cpp @@ -1008,7 +1008,7 @@ static DataScoop_t* find_scoop(FileIR_t *firp,const string &name) static unsigned int add_to_scoop(const string &str, DataScoop_t* scoop) { - // assert that this scoop is unpinned. may need to enable --step move_globals --step-option move_globals:--cfi + // assert that this scoop is unpinned. may need to enable --step move_globals --step-option move_globals:--elftables-only assert(scoop->GetStart()->GetVirtualOffset()==0); int len=str.length(); scoop->SetContents(scoop->GetContents()+str); diff --git a/tools/selective_cfi/tests/test_coreutils.sh b/tools/selective_cfi/tests/test_coreutils.sh index 20ed16a3789e9b3fbd5b5d5620b135d1fcc88270..20eb3356b7a56c3b8e505cee706a6a10ef79347f 100755 --- a/tools/selective_cfi/tests/test_coreutils.sh +++ b/tools/selective_cfi/tests/test_coreutils.sh @@ -30,7 +30,7 @@ do_cfi() return fi echo -n "$(basename $2) ... " - $PS $1 $2 --backend zipr --step move_globals=on --step selective_cfi=on --step-option selective_cfi:--multimodule --step-option move_globals:--cfi --step-option fix_calls:--fix-all --step-option zipr:"--add-sections false" > $2.ps_output 2>&1 + $PS $1 $2 --backend zipr --step move_globals=on --step selective_cfi=on --step-option selective_cfi:--multimodule --step-option move_globals:--elftables-only --step-option fix_calls:--fix-all --step-option zipr:"--add-sections false" > $2.ps_output 2>&1 check_fail $1 $2 $? } @@ -41,7 +41,7 @@ do_coloring_cfi() return fi echo -n "$(basename $2) ... " - $PS $1 $2 --backend zipr --step move_globals=on --step selective_cfi=on --step-option selective_cfi:--multimodule --step-option move_globals:--cfi --step-option fix_calls:--fix-all --step-option selective_cfi:--color --step-option zipr:"--add-sections false"> $2.ps_output 2>&1 + $PS $1 $2 --backend zipr --step move_globals=on --step selective_cfi=on --step-option selective_cfi:--multimodule --step-option move_globals:--elftables-only --step-option fix_calls:--fix-all --step-option selective_cfi:--color --step-option zipr:"--add-sections false"> $2.ps_output 2>&1 check_fail $1 $2 $? } diff --git a/tools/selective_cfi/tests/test_dude.sh b/tools/selective_cfi/tests/test_dude.sh index d7936230d45cc5af84c255b6eb117e1ca8c8ca30..845911fd2be921a0849d4f336213971dfd9f3642 100755 --- a/tools/selective_cfi/tests/test_dude.sh +++ b/tools/selective_cfi/tests/test_dude.sh @@ -5,14 +5,14 @@ do_cfi() if [[ -f $2 ]]; then echo "Eliding rebuild of $2" else - (set -x ; $PS $1 $2 --backend zipr --step move_globals=on --step selective_cfi=on --step-option selective_cfi:--multimodule --step-option move_globals:--cfi --step-option fix_calls:--fix-all --step-option zipr:"--add-sections false" ) + (set -x ; $PS $1 $2 --backend zipr --step move_globals=on --step selective_cfi=on --step-option selective_cfi:--multimodule --step-option move_globals:--elftables-only --step-option fix_calls:--fix-all --step-option zipr:"--add-sections false" ) fi } # Note: exe nonce cfi doesn't always run against non-exe nonce cfi modules do_cfi_exe_nonces() { - $PS $1 $2 --backend zipr --step move_globals=on --step selective_cfi=on --step-option selective_cfi:--multimodule --step-option move_globals:--cfi --step-option fix_calls:--no-fix-safefn --step-option selective_cfi:--exe-nonce-for-call --step-option zipr:"--add-sections false" + $PS $1 $2 --backend zipr --step move_globals=on --step selective_cfi=on --step-option selective_cfi:--multimodule --step-option move_globals:--elftables-only --step-option fix_calls:--no-fix-safefn --step-option selective_cfi:--exe-nonce-for-call --step-option zipr:"--add-sections false" } do_coloring_cfi() @@ -20,7 +20,7 @@ do_coloring_cfi() if [[ -f $2 ]]; then echo "Eliding rebuild of $2" else - (set -x ; $PS $1 $2 --backend zipr --step move_globals=on --step selective_cfi=on --step-option selective_cfi:--multimodule --step-option move_globals:--cfi --step-option fix_calls:--fix-all --step-option selective_cfi:--color --step-option zipr:"--add-sections false" ) + (set -x ; $PS $1 $2 --backend zipr --step move_globals=on --step selective_cfi=on --step-option selective_cfi:--multimodule --step-option move_globals:--elftables-only --step-option fix_calls:--fix-all --step-option selective_cfi:--color --step-option zipr:"--add-sections false" ) fi } diff --git a/tools/selective_cfi/tests/test_fib.sh b/tools/selective_cfi/tests/test_fib.sh index 70e5cb819fc158308980cf811ef8db11d85424f3..d98a3663b00f704b3d6ea23b304ba725bbad97e5 100755 --- a/tools/selective_cfi/tests/test_fib.sh +++ b/tools/selective_cfi/tests/test_fib.sh @@ -2,18 +2,18 @@ do_cfi() { - $PS $1 $2 --backend zipr --step move_globals=on --step selective_cfi=on --step-option selective_cfi:--multimodule --step-option move_globals:--cfi --step-option fix_calls:--fix-all --step-option zipr:"--add-sections false" + $PS $1 $2 --backend zipr --step move_globals=on --step selective_cfi=on --step-option selective_cfi:--multimodule --step-option move_globals:--elftables-only --step-option fix_calls:--fix-all --step-option zipr:"--add-sections false" } # Note: exe nonce cfi doesn't always run against non-exe nonce cfi modules do_cfi_exe_nonces() { - $PS $1 $2 --backend zipr --step move_globals=on --step selective_cfi=on --step-option selective_cfi:--multimodule --step-option move_globals:--cfi --step-option fix_calls:--no-fix-safefn --step-option selective_cfi:--exe-nonce-for-call --step-option zipr:"--add-sections false" + $PS $1 $2 --backend zipr --step move_globals=on --step selective_cfi=on --step-option selective_cfi:--multimodule --step-option move_globals:--elftables-only --step-option fix_calls:--no-fix-safefn --step-option selective_cfi:--exe-nonce-for-call --step-option zipr:"--add-sections false" } do_coloring_cfi() { - $PS $1 $2 --backend zipr --step move_globals=on --step selective_cfi=on --step-option selective_cfi:--multimodule --step-option move_globals:--cfi --step-option fix_calls:--fix-all --step-option selective_cfi:--color --step-option zipr:"--add-sections false" + $PS $1 $2 --backend zipr --step move_globals=on --step selective_cfi=on --step-option selective_cfi:--multimodule --step-option move_globals:--elftables-only --step-option fix_calls:--fix-all --step-option selective_cfi:--color --step-option zipr:"--add-sections false" } diff --git a/tools/selective_cfi/tests/test_foo.sh b/tools/selective_cfi/tests/test_foo.sh index 6a29affb472844add01f3a55d86d5301a1496611..827972ac22ced6af4e25777a470ffeb4118eb41f 100755 --- a/tools/selective_cfi/tests/test_foo.sh +++ b/tools/selective_cfi/tests/test_foo.sh @@ -2,18 +2,18 @@ do_cfi() { - $PS $1 $2 --backend zipr --step move_globals=on --step selective_cfi=on --step-option selective_cfi:--multimodule --step-option move_globals:--cfi --step-option fix_calls:--fix-all --step-option zipr:"--add-sections false" + $PS $1 $2 --backend zipr --step move_globals=on --step selective_cfi=on --step-option selective_cfi:--multimodule --step-option move_globals:--elftables-only --step-option fix_calls:--fix-all --step-option zipr:"--add-sections false" } # Note: exe nonce cfi doesn't always run against non-exe nonce cfi modules do_cfi_exe_nonces() { - $PS $1 $2 --backend zipr --step move_globals=on --step selective_cfi=on --step-option selective_cfi:--multimodule --step-option move_globals:--cfi --step-option fix_calls:--no-fix-safefn --step-option selective_cfi:--exe-nonce-for-call --step-option zipr:"--add-sections false" + $PS $1 $2 --backend zipr --step move_globals=on --step selective_cfi=on --step-option selective_cfi:--multimodule --step-option move_globals:--elftables-only --step-option fix_calls:--no-fix-safefn --step-option selective_cfi:--exe-nonce-for-call --step-option zipr:"--add-sections false" } do_coloring_cfi() { - $PS $1 $2 --backend zipr --step move_globals=on --step selective_cfi=on --step-option selective_cfi:--multimodule --step-option move_globals:--cfi --step-option fix_calls:--fix-all --step-option selective_cfi:--color --step-option zipr:"--add-sections false" + $PS $1 $2 --backend zipr --step move_globals=on --step selective_cfi=on --step-option selective_cfi:--multimodule --step-option move_globals:--elftables-only --step-option fix_calls:--fix-all --step-option selective_cfi:--color --step-option zipr:"--add-sections false" } diff --git a/tools/selective_cfi/tests/test_libc.sh b/tools/selective_cfi/tests/test_libc.sh index 26619ab9a3cda742c94873ac95df74624f9317b4..d765007d607cdcc5f22c294a26e28bbd669fdd7f 100755 --- a/tools/selective_cfi/tests/test_libc.sh +++ b/tools/selective_cfi/tests/test_libc.sh @@ -4,7 +4,7 @@ libcpath="" do_cfi() { - $PS $1 $2 --backend zipr --step move_globals=on --step selective_cfi=on --step-option selective_cfi:--multimodule --step-option move_globals:--cfi --step-option fix_calls:--fix-all --step-option zipr:"--add-sections false" + $PS $1 $2 --backend zipr --step move_globals=on --step selective_cfi=on --step-option selective_cfi:--multimodule --step-option move_globals:--elftables-only --step-option fix_calls:--fix-all --step-option zipr:"--add-sections false" if [ ! $? -eq 0 ]; then echo "do_cfi(): failed to protect" fi @@ -12,7 +12,7 @@ do_cfi() do_cfi_color() { - $PS $1 $2 --backend zipr --step move_globals=on --step selective_cfi=on --step-option selective_cfi:--multimodule --step-option move_globals:--cfi --step-option fix_calls:--fix-all --step-option selective_cfi:--color --step-option zipr:"--add-sections false" + $PS $1 $2 --backend zipr --step move_globals=on --step selective_cfi=on --step-option selective_cfi:--multimodule --step-option move_globals:--elftables-only --step-option fix_calls:--fix-all --step-option selective_cfi:--color --step-option zipr:"--add-sections false" if [ ! $? -eq 0 ]; then echo "do_coloring_cfi(): failed to protect" fi diff --git a/tools/selective_cfi/tests/test_pow.sh b/tools/selective_cfi/tests/test_pow.sh index 434426e89ae9c8dd031ba34c73f8efca1f29e519..054d4a71c1735c063252d242931ddb18dca67a76 100755 --- a/tools/selective_cfi/tests/test_pow.sh +++ b/tools/selective_cfi/tests/test_pow.sh @@ -2,18 +2,18 @@ do_cfi() { - (set -x ; $PS $1 $2 --backend zipr --step move_globals=on --step selective_cfi=on --step-option selective_cfi:--multimodule --step-option move_globals:--cfi --step-option fix_calls:--fix-all --step-option zipr:"--add-sections false") + (set -x ; $PS $1 $2 --backend zipr --step move_globals=on --step selective_cfi=on --step-option selective_cfi:--multimodule --step-option move_globals:--elftables-only --step-option fix_calls:--fix-all --step-option zipr:"--add-sections false") } # Note: exe nonce cfi doesn't always run against non-exe nonce cfi modules do_cfi_exe_nonces() { - $PS $1 $2 --backend zipr --step move_globals=on --step selective_cfi=on --step-option selective_cfi:--multimodule --step-option move_globals:--cfi --step-option fix_calls:--no-fix-safefn --step-option selective_cfi:--exe-nonce-for-call --step-option zipr:"--add-sections false" + $PS $1 $2 --backend zipr --step move_globals=on --step selective_cfi=on --step-option selective_cfi:--multimodule --step-option move_globals:--elftables-only --step-option fix_calls:--no-fix-safefn --step-option selective_cfi:--exe-nonce-for-call --step-option zipr:"--add-sections false" } do_coloring_cfi() { - (set -x ; $PS $1 $2 --backend zipr --step move_globals=on --step selective_cfi=on --step-option selective_cfi:--multimodule --step-option move_globals:--cfi --step-option fix_calls:--fix-all --step-option selective_cfi:--color --step-option zipr:"--add-sections false" ) + (set -x ; $PS $1 $2 --backend zipr --step move_globals=on --step selective_cfi=on --step-option selective_cfi:--multimodule --step-option move_globals:--elftables-only --step-option fix_calls:--fix-all --step-option selective_cfi:--color --step-option zipr:"--add-sections false" ) } diff --git a/tools/selective_cfi/tests/test_spec.sh b/tools/selective_cfi/tests/test_spec.sh index 575b2cfcd71abf89a92633062e3831c41dc02c26..a67af4964a1aafe5cad1db517f062350915c028f 100755 --- a/tools/selective_cfi/tests/test_spec.sh +++ b/tools/selective_cfi/tests/test_spec.sh @@ -136,8 +136,8 @@ main() local zipr_flags="--backend zipr" - local mm_basic_cfi_flags="--step move_globals=on --step selective_cfi=on --step-option selective_cfi:--multimodule --step-option move_globals:--cfi --step-option fix_calls:--fix-all " - local mm_basic_cfi_exe_nonces_flags="--step move_globals=on --step selective_cfi=on --step-option selective_cfi:--multimodule --step-option move_globals:--cfi --step-option fix_calls:--no-fix-safefn --step-option selective_cfi:--exe-nonce-for-call " + local mm_basic_cfi_flags="--step move_globals=on --step selective_cfi=on --step-option selective_cfi:--multimodule --step-option move_globals:--elftables-only --step-option fix_calls:--fix-all " + local mm_basic_cfi_exe_nonces_flags="--step move_globals=on --step selective_cfi=on --step-option selective_cfi:--multimodule --step-option move_globals:--elftables-only --step-option fix_calls:--no-fix-safefn --step-option selective_cfi:--exe-nonce-for-call " local mm_color_cfi_flags="$mm_basic_cfi_flags --step-option selective_cfi:--color" local trace_flags="-o zipr:--traceplacement:on -o zipr:true"