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>
This commit is contained in:
Thomas Weißschuh 2023-05-21 11:36:32 +02:00 committed by Paul E. McKenney
parent 88fc7eb54e
commit 8525092104

View File

@ -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();