public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] string: Disable stack protector for memset in early static initialization
@ 2024-01-22 13:45 Adhemerval Zanella
  2024-01-22 13:51 ` Florian Weimer
  2024-01-22 13:56 ` Andreas Schwab
  0 siblings, 2 replies; 3+ messages in thread
From: Adhemerval Zanella @ 2024-01-22 13:45 UTC (permalink / raw)
  To: libc-alpha; +Cc: Andreas Schwab, Florian Weimer

For ports that use the default memset, the compiler might generic early
calls before the stack protector is initialized (for instance, riscv
with -fstack-protector-all on _dl_aux_init).

Checked on riscv64-linux-gnu-rv64imafdc-lp64d.
---
 string/Makefile | 1 +
 1 file changed, 1 insertion(+)

diff --git a/string/Makefile b/string/Makefile
index 3ba77e1b2f..8f31fa49e6 100644
--- a/string/Makefile
+++ b/string/Makefile
@@ -270,6 +270,7 @@ CFLAGS-memcpy.c += $(no-stack-protector)
 CFLAGS-wordcopy.c += $(no-stack-protector)
 # Called during static initialization
 CFLAGS-strncmp.c += $(no-stack-protector)
+CFLAGS-memset.c += $(no-stack-protector)
 
 CFLAGS-argz-next.c += $(config-cflags-wno-ignored-attributes)
 CFLAGS-basename.c += $(config-cflags-wno-ignored-attributes)
-- 
2.34.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] string: Disable stack protector for memset in early static initialization
  2024-01-22 13:45 [PATCH] string: Disable stack protector for memset in early static initialization Adhemerval Zanella
@ 2024-01-22 13:51 ` Florian Weimer
  2024-01-22 13:56 ` Andreas Schwab
  1 sibling, 0 replies; 3+ messages in thread
From: Florian Weimer @ 2024-01-22 13:51 UTC (permalink / raw)
  To: Adhemerval Zanella; +Cc: libc-alpha, Andreas Schwab

* Adhemerval Zanella:

> For ports that use the default memset, the compiler might generic early
> calls before the stack protector is initialized (for instance, riscv
> with -fstack-protector-all on _dl_aux_init).
>
> Checked on riscv64-linux-gnu-rv64imafdc-lp64d.
> ---
>  string/Makefile | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/string/Makefile b/string/Makefile
> index 3ba77e1b2f..8f31fa49e6 100644
> --- a/string/Makefile
> +++ b/string/Makefile
> @@ -270,6 +270,7 @@ CFLAGS-memcpy.c += $(no-stack-protector)
>  CFLAGS-wordcopy.c += $(no-stack-protector)
>  # Called during static initialization
>  CFLAGS-strncmp.c += $(no-stack-protector)
> +CFLAGS-memset.c += $(no-stack-protector)
>  
>  CFLAGS-argz-next.c += $(config-cflags-wno-ignored-attributes)
>  CFLAGS-basename.c += $(config-cflags-wno-ignored-attributes)

Looks okay to me, thanks.

Reviewed-by: Florian Weimer <fweimer@redhat.com>

Florian


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] string: Disable stack protector for memset in early static initialization
  2024-01-22 13:45 [PATCH] string: Disable stack protector for memset in early static initialization Adhemerval Zanella
  2024-01-22 13:51 ` Florian Weimer
@ 2024-01-22 13:56 ` Andreas Schwab
  1 sibling, 0 replies; 3+ messages in thread
From: Andreas Schwab @ 2024-01-22 13:56 UTC (permalink / raw)
  To: Adhemerval Zanella; +Cc: libc-alpha, Florian Weimer

On Jan 22 2024, Adhemerval Zanella wrote:

> For ports that use the default memset, the compiler might generic early

s/generic/generate/

-- 
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-01-22 13:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-01-22 13:45 [PATCH] string: Disable stack protector for memset in early static initialization Adhemerval Zanella
2024-01-22 13:51 ` Florian Weimer
2024-01-22 13:56 ` Andreas Schwab

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).