public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc] x86/cet: Run some CET tests with shadow stack
@ 2024-01-01 13:24 H.J. Lu
  0 siblings, 0 replies; only message in thread
From: H.J. Lu @ 2024-01-01 13:24 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=cf9481724bcb86ad4a86cca7befed74bb9cc15eb

commit cf9481724bcb86ad4a86cca7befed74bb9cc15eb
Author: H.J. Lu <hjl.tools@gmail.com>
Date:   Fri Dec 29 08:43:54 2023 -0800

    x86/cet: Run some CET tests with shadow stack
    
    When CET is disabled by default, run some CET tests with shadow stack
    enabled using
    
    $ export GLIBC_TUNABLES=glibc.cpu.hwcaps=SHSTK

Diff:
---
 sysdeps/x86/Makefile                      | 14 ++++++++++++++
 sysdeps/x86/tst-shstk-legacy-1e-static.sh |  1 +
 sysdeps/x86/tst-shstk-legacy-1e.sh        |  1 +
 sysdeps/x86/tst-shstk-legacy-1g.sh        |  1 +
 4 files changed, 17 insertions(+)

diff --git a/sysdeps/x86/Makefile b/sysdeps/x86/Makefile
index 0aafd2afeb..a49b13c595 100644
--- a/sysdeps/x86/Makefile
+++ b/sysdeps/x86/Makefile
@@ -249,6 +249,13 @@ CFLAGS-tst-cet-legacy-10-static.c += -mshstk
 CFLAGS-tst-cet-legacy-10a.c += -fcf-protection=none
 CFLAGS-tst-cet-legacy-10a-static.c += -fcf-protection=none
 
+tst-cet-legacy-4-ENV = GLIBC_TUNABLES=glibc.cpu.hwcaps=SHSTK
+tst-cet-legacy-6-ENV = GLIBC_TUNABLES=glibc.cpu.hwcaps=SHSTK
+tst-cet-legacy-10-ENV = GLIBC_TUNABLES=glibc.cpu.hwcaps=SHSTK
+tst-cet-legacy-10-static-ENV = GLIBC_TUNABLES=glibc.cpu.hwcaps=SHSTK
+tst-cet-legacy-10a-ENV = GLIBC_TUNABLES=glibc.cpu.hwcaps=SHSTK
+tst-cet-legacy-10a-static-ENV = GLIBC_TUNABLES=glibc.cpu.hwcaps=SHSTK
+
 CFLAGS-tst-shstk-legacy-1a.c += -fcf-protection=none
 CFLAGS-tst-shstk-legacy-1a-static.c += -fcf-protection=none
 CFLAGS-tst-shstk-legacy-1d.c += -fcf-protection=none
@@ -288,14 +295,20 @@ tst-cet-legacy-6b-ENV = GLIBC_TUNABLES=glibc.cpu.hwcaps=-IBT,-SHSTK
 tst-cet-legacy-9-ENV = GLIBC_TUNABLES=glibc.cpu.hwcaps=-IBT,-SHSTK
 tst-cet-legacy-9-static-ENV = GLIBC_TUNABLES=glibc.cpu.hwcaps=-IBT,-SHSTK
 
+tst-shstk-legacy-1a-ENV = GLIBC_TUNABLES=glibc.cpu.hwcaps=SHSTK
+tst-shstk-legacy-1a-static-ENV = GLIBC_TUNABLES=glibc.cpu.hwcaps=SHSTK
 $(objpfx)tst-shstk-legacy-1a: $(objpfx)tst-shstk-legacy-1-extra.o
 $(objpfx)tst-shstk-legacy-1a-static: $(objpfx)tst-shstk-legacy-1-extra.o
+tst-shstk-legacy-1b-ENV = GLIBC_TUNABLES=glibc.cpu.hwcaps=SHSTK
+tst-shstk-legacy-1b-static-ENV = GLIBC_TUNABLES=glibc.cpu.hwcaps=SHSTK
 $(objpfx)tst-shstk-legacy-1b: $(objpfx)tst-shstk-legacy-1-extra.o
 $(objpfx)tst-shstk-legacy-1b-static: $(objpfx)tst-shstk-legacy-1-extra.o
 tst-shstk-legacy-1c-ENV = GLIBC_TUNABLES=glibc.cpu.hwcaps=-SHSTK
 tst-shstk-legacy-1c-static-ENV = GLIBC_TUNABLES=glibc.cpu.hwcaps=-SHSTK
 $(objpfx)tst-shstk-legacy-1c: $(objpfx)tst-shstk-legacy-1-extra.o
 $(objpfx)tst-shstk-legacy-1c-static: $(objpfx)tst-shstk-legacy-1-extra.o
+tst-shstk-legacy-1d-ENV = GLIBC_TUNABLES=glibc.cpu.hwcaps=SHSTK
+tst-shstk-legacy-1d-static-ENV = GLIBC_TUNABLES=glibc.cpu.hwcaps=SHSTK
 $(objpfx)tst-shstk-legacy-1d: $(objpfx)tst-shstk-legacy-1-extra.o
 $(objpfx)tst-shstk-legacy-1d-static: $(objpfx)tst-shstk-legacy-1-extra.o
 $(objpfx)tst-shstk-legacy-1e: $(objpfx)tst-shstk-legacy-1-extra.o
@@ -309,6 +322,7 @@ $(objpfx)tst-shstk-legacy-1e-static.out: \
   $(objpfx)tst-shstk-legacy-1e-static
 	$(SHELL) $< $(common-objpfx) 2> $@; \
 	$(evaluate-test)
+tst-shstk-legacy-1f-ENV = GLIBC_TUNABLES=glibc.cpu.hwcaps=SHSTK
 $(objpfx)tst-shstk-legacy-1f: $(objpfx)tst-shstk-legacy-mod-1.so
 $(objpfx)tst-shstk-legacy-mod-1.so: \
   $(objpfx)tst-shstk-legacy-mod-1.os \
diff --git a/sysdeps/x86/tst-shstk-legacy-1e-static.sh b/sysdeps/x86/tst-shstk-legacy-1e-static.sh
index e943aec70e..008c50dae3 100755
--- a/sysdeps/x86/tst-shstk-legacy-1e-static.sh
+++ b/sysdeps/x86/tst-shstk-legacy-1e-static.sh
@@ -20,6 +20,7 @@
 
 common_objpfx=$1; shift
 
+GLIBC_TUNABLES=glibc.cpu.hwcaps=SHSTK \
 ${common_objpfx}elf/tst-shstk-legacy-1e-static
 # The exit status should only be unsupported (77) or segfault (139).
 status=$?
diff --git a/sysdeps/x86/tst-shstk-legacy-1e.sh b/sysdeps/x86/tst-shstk-legacy-1e.sh
index b0467aa899..82f2acbf75 100755
--- a/sysdeps/x86/tst-shstk-legacy-1e.sh
+++ b/sysdeps/x86/tst-shstk-legacy-1e.sh
@@ -21,6 +21,7 @@
 common_objpfx=$1; shift
 test_program_prefix=$1; shift
 
+GLIBC_TUNABLES=glibc.cpu.hwcaps=SHSTK \
 ${test_program_prefix} \
   ${common_objpfx}elf/tst-shstk-legacy-1e
 # The exit status should only be unsupported (77) or segfault (139).
diff --git a/sysdeps/x86/tst-shstk-legacy-1g.sh b/sysdeps/x86/tst-shstk-legacy-1g.sh
index c112bf6d8d..261eef7cac 100755
--- a/sysdeps/x86/tst-shstk-legacy-1g.sh
+++ b/sysdeps/x86/tst-shstk-legacy-1g.sh
@@ -21,6 +21,7 @@
 common_objpfx=$1; shift
 test_program_prefix=$1; shift
 
+GLIBC_TUNABLES=glibc.cpu.hwcaps=SHSTK \
 ${test_program_prefix} \
   ${common_objpfx}elf/tst-shstk-legacy-1g
 # The exit status should only be unsupported (77) or segfault (139).

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-01-01 13:24 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-01 13:24 [glibc] x86/cet: Run some CET tests with shadow stack H.J. Lu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).