glibc/sysdeps/x86
H.J. Lu 457bd9cf2e x86-64: Check if mprotect works before rewriting PLT
Systemd execution environment configuration may prohibit changing a memory
mapping to become executable:

MemoryDenyWriteExecute=
Takes a boolean argument. If set, attempts to create memory mappings
that are writable and executable at the same time, or to change existing
memory mappings to become executable, or mapping shared memory segments
as executable, are prohibited.

When it is set, systemd service stops working if PLT rewrite is enabled.
Check if mprotect works before rewriting PLT.  This fixes BZ #31230.
This also works with SELinux when deny_execmem is on.
Reviewed-by: Carlos O'Donell <carlos@redhat.com>
2024-01-15 06:59:23 -08:00
..
bits x86-64/cet: Make CET feature check specific to Linux/x86 2024-01-11 20:35:24 -08:00
fpu Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
htl Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
include Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
nptl Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
sys/platform x86-64/cet: Make CET feature check specific to Linux/x86 2024-01-11 20:35:24 -08:00
__longjmp_cancel.S x86-64/cet: Check the restore token in longjmp 2024-01-04 13:38:26 -08:00
abi-note.c Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
atomic-machine.h Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
cacheinfo.c Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
cacheinfo.h Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
configure i386: Ignore --enable-cet 2024-01-04 06:08:55 -08:00
configure.ac i386: Ignore --enable-cet 2024-01-04 06:08:55 -08:00
cpu-features-offsets.sym i386: Remove CET support bits 2024-01-10 05:20:20 -08:00
cpu-features.c x86-64: Check if mprotect works before rewriting PLT 2024-01-15 06:59:23 -08:00
cpu-tunables.c Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
dl-cacheinfo.h Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
dl-diagnostics-cpu.c Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
dl-get-cpu-features.c Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
dl-hwcap2.h Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
dl-hwcap.h Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
dl-isa-level.h Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
dl-lookupcfg.h Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
dl-minsigstacksize.h Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
dl-new-hash.h Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
dl-procinfo.c Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
dl-procinfo.h Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
dl-prop.h Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
dl-tunables.list elf: Add ELF_DYNAMIC_AFTER_RELOC to rewrite PLT 2024-01-05 05:49:49 -08:00
elf-initfini.h Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
elide.h Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
float128-abi.h Move __isnanf128 to libc.so 2021-03-30 14:58:19 +05:30
fpu_control.h Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
get-cpuid-feature-leaf.c x86-64/cet: Make CET feature check specific to Linux/x86 2024-01-11 20:35:24 -08:00
get-isa-level.h Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
hp-timing.h Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
init-arch.h Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
isa-ifunc-macros.h Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
isa-level.c Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
isa-level.h Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
jmp_buf-ssp.sym x86: Support shadow stack pointer in setjmp/longjmp 2018-07-14 05:59:53 -07:00
ldbl2mpn.c Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
ldsodefs.h i386: Remove CET support bits 2024-01-10 05:20:20 -08:00
libc-start.c Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
link_map.h Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
linkmap.h Rename bits/linkmap.h to linkmap.h (bug 14912). 2015-09-04 19:44:27 +00:00
longjmp.c Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
Makeconfig Add _Float64x function aliases. 2017-11-27 14:16:47 +00:00
Makefile x86-64/cet: Make CET feature check specific to Linux/x86 2024-01-11 20:35:24 -08:00
readelflib.c Remove ia64-linux-gnu 2024-01-08 17:09:36 -03:00
sysdep.h i386: Remove CET support 2024-01-09 13:55:51 -03:00
tininess.h Use sysdeps/x86/tininess.h for i386 and x86_64 2012-10-30 20:38:31 -07:00
tst-cpu-features-cpuinfo-static.c x86: Add PTWRITE feature detection [BZ #27346] 2021-02-07 08:01:14 -08:00
tst-cpu-features-cpuinfo.c Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
tst-cpu-features-supports-static.c x86: Add PTWRITE feature detection [BZ #27346] 2021-02-07 08:01:14 -08:00
tst-cpu-features-supports.c Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
tst-get-cpu-features-static.c Add _dl_x86_cpu_features to rtld_global 2015-08-13 03:41:22 -07:00
tst-get-cpu-features.c Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
tst-hwcap-tunables.c Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
tst-ifunc-isa-1-static.c x86: Check ifunc resolver with CPU_FEATURE_USABLE [BZ #27072] 2021-01-21 10:22:26 -08:00
tst-ifunc-isa-1.c Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
tst-ifunc-isa-2-static.c x86: Check ifunc resolver with CPU_FEATURE_USABLE [BZ #27072] 2021-01-21 10:22:26 -08:00
tst-ifunc-isa-2.c Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
tst-ifunc-isa.h Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
tst-isa-level-1.c Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
tst-isa-level-mod-1-baseline.c x86: Support GNU_PROPERTY_X86_ISA_1_V[234] marker [BZ #26717] 2021-01-07 13:10:13 -08:00
tst-isa-level-mod-1-v2.c x86: Support GNU_PROPERTY_X86_ISA_1_V[234] marker [BZ #26717] 2021-01-07 13:10:13 -08:00
tst-isa-level-mod-1-v3.c x86: Support GNU_PROPERTY_X86_ISA_1_V[234] marker [BZ #26717] 2021-01-07 13:10:13 -08:00
tst-isa-level-mod-1-v4.c x86: Support GNU_PROPERTY_X86_ISA_1_V[234] marker [BZ #26717] 2021-01-07 13:10:13 -08:00
tst-isa-level-mod-1.c Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
tst-ldbl-nonnormal-printf.c Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
tst-memchr-rtm.c Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
tst-memcmp-rtm.c Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
tst-memmove-rtm.c Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
tst-memrchr-rtm.c Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
tst-memset-rtm.c Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
tst-setjmp-cet.c x86: Set header.feature_1 in TCB for always-on CET [BZ #27177] 2021-01-13 05:03:34 -08:00
tst-stack-align.h Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
tst-strcasecmp-rtm.c Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
tst-strchr-rtm.c Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
tst-strcmp-rtm.c Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
tst-strcpy-rtm.c Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
tst-string-rtm.h Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
tst-strlen-rtm.c Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
tst-strncasecmp-rtm.c Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
tst-strncmp-rtm.c Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
tst-strrchr-rtm.c Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
tst-sysconf-cache-linesize-static.c x86: Handle _SC_LEVEL1_ICACHE_LINESIZE [BZ #27444] 2021-03-15 05:43:26 -07:00
tst-sysconf-cache-linesize.c Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
tst-wcscmp-rtm.c Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
tst-wcsncmp-rtm.c Update copyright dates with scripts/update-copyrights 2024-01-01 10:53:40 -08:00
Versions <sys/platform/x86.h>: Remove the C preprocessor magic 2021-01-21 05:58:17 -08:00