* [PATCH] tools/nolibc: s390: disable stackprotector in _start
@ 2023-05-24 16:27 Thomas Weißschuh
2023-05-24 16:30 ` Willy Tarreau
0 siblings, 1 reply; 2+ messages in thread
From: Thomas Weißschuh @ 2023-05-24 16:27 UTC (permalink / raw)
To: Willy Tarreau; +Cc: linux-kernel, Thomas Weißschuh
s390 does not support the "global" stack protector mode that is
implemented in nolibc.
Now that nolibc detects if stack protectors are enabled at runtime it
could happen that a future compiler does indeed use global mode on
and nolibc would compile but segfault at runtime.
To avoid this hypothetic case and to align s390 with the other
architectures disable stack protectors when compiling _start().
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
---
tools/include/nolibc/arch-s390.h | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/tools/include/nolibc/arch-s390.h b/tools/include/nolibc/arch-s390.h
index a738e7f3f8e8..516dff5bff8b 100644
--- a/tools/include/nolibc/arch-s390.h
+++ b/tools/include/nolibc/arch-s390.h
@@ -8,6 +8,8 @@
#include <asm/signal.h>
#include <asm/unistd.h>
+#include "compiler.h"
+
/* The struct returned by the stat() syscall, equivalent to stat64(). The
* syscall returns 116 bytes and stops in the middle of __unused.
*/
@@ -164,7 +166,7 @@ char **environ __attribute__((weak));
const unsigned long *_auxv __attribute__((weak));
/* startup code */
-void __attribute__((weak,noreturn,optimize("omit-frame-pointer"))) _start(void)
+void __attribute__((weak,noreturn,optimize("omit-frame-pointer"))) __no_stack_protector _start(void)
{
__asm__ volatile (
"lg %r2,0(%r15)\n" /* argument count */
---
base-commit: d5d0994c2f3cae2d2bdc04b98c6212e72efe0509
change-id: 20230524-nolibc-stackprotector-s390-0bc5c197ff6f
Best regards,
--
Thomas Weißschuh <linux@weissschuh.net>
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] tools/nolibc: s390: disable stackprotector in _start
2023-05-24 16:27 [PATCH] tools/nolibc: s390: disable stackprotector in _start Thomas Weißschuh
@ 2023-05-24 16:30 ` Willy Tarreau
0 siblings, 0 replies; 2+ messages in thread
From: Willy Tarreau @ 2023-05-24 16:30 UTC (permalink / raw)
To: Thomas Weißschuh; +Cc: linux-kernel
On Wed, May 24, 2023 at 06:27:06PM +0200, Thomas Weißschuh wrote:
> s390 does not support the "global" stack protector mode that is
> implemented in nolibc.
>
> Now that nolibc detects if stack protectors are enabled at runtime it
> could happen that a future compiler does indeed use global mode on
> and nolibc would compile but segfault at runtime.
>
> To avoid this hypothetic case and to align s390 with the other
> architectures disable stack protectors when compiling _start().
(...)
Queued, same branch. Thanks Thomas!
Willy
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-05-24 16:30 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-24 16:27 [PATCH] tools/nolibc: s390: disable stackprotector in _start Thomas Weißschuh
2023-05-24 16:30 ` Willy Tarreau
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox