mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jens Remus <jremus@linux.ibm.com>
To: Heiko Carstens <hca@linux.ibm.com>
Cc: linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org,
	Vasily Gorbik <gor@linux.ibm.com>,
	Alexander Gordeev <agordeev@linux.ibm.com>,
	Sven Schnelle <svens@linux.ibm.com>,
	Ilya Leoshkevich <iii@linux.ibm.com>
Subject: Re: [PATCH 0/2] s390/vdso: Fix GNU_EH_FRAME PHDR
Date: Mon, 13 Jul 2026 17:34:09 +0200	[thread overview]
Message-ID: <3b4603ba-1d56-4540-b927-9002605fc137@linux.ibm.com> (raw)
In-Reply-To: <20260710074600.17568Beb-hca@linux.ibm.com>

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@linux.ibm.com>

Thanks!

Regards,
Jens
-- 
Jens Remus
Linux on Z Development (D3303)
jremus@de.ibm.com / jremus@linux.ibm.com

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/


      reply	other threads:[~2026-07-13 15:34 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-06 15:19 Jens Remus
2026-07-06 15:19 ` [PATCH 1/2] s390/vdso: Pass --eh-frame-hdr to the linker Jens Remus
2026-07-06 15:22   ` Jens Remus
2026-07-06 17:26   ` Ilya Leoshkevich
2026-07-06 15:19 ` [PATCH 2/2] s390/vdso: Use symbolic constants for the PHDR permission flags Jens Remus
2026-07-06 17:06   ` Ilya Leoshkevich
2026-07-07  7:32     ` Jens Remus
2026-07-10  7:46 ` [PATCH 0/2] s390/vdso: Fix GNU_EH_FRAME PHDR Heiko Carstens
2026-07-13 15:34   ` Jens Remus [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3b4603ba-1d56-4540-b927-9002605fc137@linux.ibm.com \
    --to=jremus@linux.ibm.com \
    --cc=agordeev@linux.ibm.com \
    --cc=gor@linux.ibm.com \
    --cc=hca@linux.ibm.com \
    --cc=iii@linux.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=svens@linux.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®