Re: [PATCH 0/2] s390/vdso: Fix GNU_EH_FRAME PHDR
From: Jens Remus
Date: Mon Jul 13 2026 - 11:35:50 EST
On 7/10/2026 9:46 AM, Heiko Carstens wrote:
> On Mon, Jul 06, 2026 at 05:19:07PM +0200, Jens Remus wrote:
>> Patch 1 fixes the empty GNU_EH_FRAME program table header entry to
>> enable unwinders and stacktracers to locate the .eh_frame_hdr section.
>>
>> Patch 2 uses symbolic constants for the PHDR permission flags to improve
>> readability and explicitly specifies the GNU_EH_FRAME PHDR to be read-
>> only.
...
>> Jens Remus (2):
>> s390/vdso: Pass --eh-frame-hdr to the linker
>> s390/vdso: Use symbolic constants for the PHDR permission flags
>>
>> arch/s390/kernel/vdso/Makefile | 3 ++-
>> arch/s390/kernel/vdso/vdso.lds.S | 12 ++++++++----
>> 2 files changed, 10 insertions(+), 5 deletions(-)
>
> This series is in limbo state. Do you plan to send a new version to
> address the very minor nits, or should it stay as is?
Sorry for the delay! I have sent a v2.
I tried hard to figure out whether adding a proper GNU_STACK PHDR
with RW in a separate commit (similar to x86 commit 8717b02b8c03
("x86/entry/vdso: Include GNU_PROPERTY and GNU_STACK PHDRs") would
provide any benefit on s390:
Loading executables in the kernel:
- s390, unlike other archs, does not provide an arch-specific
elf_read_implies_exec(), therefore the generic from include/linux/elf.h
that returns false is used.
- As a consequence fs/binfmt_elf.c, load_elf_binary() does not default
executables without GNU_STACK PHDR to executable stack.
Loading shared libraries in Glibc:
- elf/dl-load.c, _dl_map_object_from_fd() does default shared libraries
without GNU_STACK PHDR to executable stack (see DEFAULT_STACK_PERMS).
Based on that I performed the following tests, all using an executable
with GNU_STACK RW (not RWX):
Library with GNU_STACK RWX loaded at startup: [stack] rwxp (exec=YES)
Library with GNU_STACK RW loaded at startup: [stack] rw-p (exec=NO)
Library without GNU_STACK loaded at startup: [stack] rwxp (exec=YES)
Library with GNU_STACK RWX loaded via dlopen: fails *1)
Library with GNU_STACK RW loaded via dlopen: [stack] rw-p (exec=NO)
Library without GNU_STACK loaded via dlopen: fails *1)
vDSO without GNU_STACK loaded via startup: [stack] rw-p (exec=NO) *2)
vDSO without GNU_STACK loaded via dlopen : [stack] rw-p (exec=NO) *3)
*1) dlopen fails with cannot enable executable stack as shared object
requires: Invalid argument. Regardless of glibc.rtld.execstack=1
tunable.
*2) Linking against /usr/modules/.../vdso/vdso.so (won't be listed in
ldd output though)
*3) dlopen("linux-vdso.so.1", RTLD_NOW);
Technically adding a GNU_STACK PHDR with RW seems to be the right
thing, although I could not construct a use case, where it would
really matter.
> In any case:
> Acked-by: Heiko Carstens <hca@xxxxxxxxxxxxx>
Thanks!
Regards,
Jens
--
Jens Remus
Linux on Z Development (D3303)
jremus@xxxxxxxxxx / jremus@xxxxxxxxxxxxx
IBM Deutschland Research & Development GmbH; Vorsitzender des Aufsichtsrats: Wolfgang Wendt; Geschäftsführung: David Faller; Sitz der Gesellschaft: Ehningen; Registergericht: Amtsgericht Stuttgart, HRB 243294
IBM Data Privacy Statement: https://www.ibm.com/privacy/