]> git.ipfire.org Git - thirdparty/glibc.git/commit
mips: Force RWX stack for hard-float builds that can run on pre-4.8 kernels
authorDragan Mladjenovic <dmladjenovic@wavecomp.com>
Fri, 23 Aug 2019 16:38:04 +0000 (16:38 +0000)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Tue, 5 Nov 2019 11:41:37 +0000 (08:41 -0300)
commit910576119f1876f7a522be826302c399c1f40ca7
tree4e25f50c28aecd04ab61da2c8718872b8cd8fb92
parent9146dc9d73aba08cf3fc2613a3f946c219dd2a52
mips: Force RWX stack for hard-float builds that can run on pre-4.8 kernels

Linux/Mips kernels prior to 4.8 could potentially crash the user
process when doing FPU emulation while running on non-executable
user stack.

Currently, gcc doesn't emit .note.GNU-stack for mips, but that will
change in the future. To ensure that glibc can be used with such
future gcc, without silently resulting in binaries that might crash
in runtime, this patch forces RWX stack for all built objects if
configured to run against minimum kernel version less than 4.8.

* sysdeps/unix/sysv/linux/mips/Makefile
(test-xfail-check-execstack):
Move under mips-has-gnustack != yes.
(CFLAGS-.o*, ASFLAGS-.o*): New rules.
Apply -Wa,-execstack if mips-force-execstack == yes.
* sysdeps/unix/sysv/linux/mips/configure: Regenerated.
* sysdeps/unix/sysv/linux/mips/configure.ac
(mips-force-execstack): New var.
Set to yes for hard-float builds with minimum_kernel < 4.8.0
or minimum_kernel not set at all.
(mips-has-gnustack): New var.
Use value of libc_cv_as_noexecstack
if mips-force-execstack != yes, otherwise set to no.

(cherry picked from commit 33bc9efd91de1b14354291fc8ebd5bce96379f12)
ChangeLog
sysdeps/unix/sysv/linux/mips/Makefile
sysdeps/unix/sysv/linux/mips/configure
sysdeps/unix/sysv/linux/mips/configure.ac