aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Weißschuh <linux@weissschuh.net>2023-05-21 11:36:32 +0200
committerPaul E. McKenney <paulmck@kernel.org>2023-06-09 11:46:08 -0700
commit8525092104ca97d5131fe594081dc176bcce34b5 (patch)
treeb509dca5b591b9871d6466dec907c4f2b22f4fb6
parent88fc7eb54ecc6db8b773341ce39ad201066fa7da (diff)
tools/nolibc: add test for __stack_chk_guard initialization
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net> Signed-off-by: Willy Tarreau <w@1wt.eu> Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
-rw-r--r--tools/testing/selftests/nolibc/nolibc-test.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/tools/testing/selftests/nolibc/nolibc-test.c b/tools/testing/selftests/nolibc/nolibc-test.c
index d5d4dea63cd6..861b9a74b71f 100644
--- a/tools/testing/selftests/nolibc/nolibc-test.c
+++ b/tools/testing/selftests/nolibc/nolibc-test.c
@@ -808,6 +808,14 @@ static int run_protection(int min, int max)
return 0;
#endif
+#if defined(NOLIBC_STACKPROTECTOR)
+ if (!__stack_chk_guard) {
+ llen += printf("__stack_chk_guard not initialized");
+ pad_spc(llen, 64, "[FAIL]\n");
+ return 1;
+ }
+#endif
+
pid = -1;
pid = fork();