diff options
author | Thomas Weißschuh <linux@weissschuh.net> | 2023-05-24 09:44:44 +0300 |
---|---|---|
committer | Paul E. McKenney <paulmck@kernel.org> | 2023-06-09 21:46:08 +0300 |
commit | e76b70dec9c257f4ccebd7f98d1de97ed071f0d1 (patch) | |
tree | 456bf7d0012877ac615cb4264811d326d33c7718 /tools/include/nolibc/stackprotector.h | |
parent | 0093c2dae8d37595c3c7fcc626b51300699a003b (diff) | |
download | linux-e76b70dec9c257f4ccebd7f98d1de97ed071f0d1.tar.xz |
tools/nolibc: fix segfaults on compilers without attribute no_stack_protector
Not all compilers, notably GCC < 10, have support for
__attribute__((no_stack_protector)).
Fall back to a mechanism that also works there.
Tested with GCC 9.5.0 from kernel.org crosstools.
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>
Diffstat (limited to 'tools/include/nolibc/stackprotector.h')
-rw-r--r-- | tools/include/nolibc/stackprotector.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/include/nolibc/stackprotector.h b/tools/include/nolibc/stackprotector.h index 0a89e2b89ca6..88f7b2d098ff 100644 --- a/tools/include/nolibc/stackprotector.h +++ b/tools/include/nolibc/stackprotector.h @@ -37,7 +37,7 @@ void __stack_chk_fail_local(void) __attribute__((weak,section(".data.nolibc_stack_chk"))) uintptr_t __stack_chk_guard; -__attribute__((weak,no_stack_protector,section(".text.nolibc_stack_chk"))) +__attribute__((weak,section(".text.nolibc_stack_chk"))) __no_stack_protector void __stack_chk_init(void) { my_syscall3(__NR_getrandom, &__stack_chk_guard, sizeof(__stack_chk_guard), 0); |