From: Stefan Liebler Date: Thu, 16 Dec 2021 11:47:11 +0000 (+0100) Subject: Fix __minimal_malloc segfaults in __mmap due to stack-protector X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=95e206b67ff5fb9a90c522466df6993a2a1a4c89;p=thirdparty%2Fglibc.git Fix __minimal_malloc segfaults in __mmap due to stack-protector Starting with commit b05fae4d8e34604a72ee36d2d3164391b76fcf0b "elf: Use the minimal malloc on tunables_strdup", I get lots of segfaults in static tests on s390x when also using, e.g.: export GLIBC_TUNABLES="glibc.elision.enable=1" tunables_strdup callls __minimal_malloc which tries to call __mmap due to insufficient space left. __mmap itself first setups a new stack frame and segfaults when copying the stack-protector canary from thread-pointer. The latter one is not yet setup. Thus this patch also turns off stack-protection for mmap. Reviewed-by: Siddhesh Poyarekar --- diff --git a/misc/Makefile b/misc/Makefile index e167e199eb6..ae53ae7df88 100644 --- a/misc/Makefile +++ b/misc/Makefile @@ -136,6 +136,10 @@ CFLAGS-sbrk.o = $(no-stack-protector) CFLAGS-sbrk.op = $(no-stack-protector) CFLAGS-brk.o = $(no-stack-protector) CFLAGS-brk.op = $(no-stack-protector) +CFLAGS-mmap.o = $(no-stack-protector) +CFLAGS-mmap.op = $(no-stack-protector) +CFLAGS-mmap64.o = $(no-stack-protector) +CFLAGS-mmap64.op = $(no-stack-protector) include ../Rules