Re: [PATCH 2/2] s390/vdso: Use symbolic constants for the PHDR permission flags

From: Jens Remus

Date: Tue Jul 07 2026 - 03:34:27 EST


On 7/6/2026 7:06 PM, Ilya Leoshkevich wrote:
> On 7/6/26 17:19, Jens Remus wrote:
>> While at it explicitly specify GNU_EH_FRAME PHDR to be read-only.
>>
>> Inspired by x86 commit 8717b02b8c03 ("x86/entry/vdso: Include
>> GNU_PROPERTY and GNU_STACK PHDRs").
>>
>> Signed-off-by: Jens Remus <jremus@xxxxxxxxxxxxx>
>> ---
>>   arch/s390/kernel/vdso/vdso.lds.S | 12 ++++++++----
>>   1 file changed, 8 insertions(+), 4 deletions(-)
>>
>> diff --git a/arch/s390/kernel/vdso/vdso.lds.S b/arch/s390/kernel/vdso/vdso.lds.S
>> index 7bec4de0e8e0..35ea7ede06c0 100644
>> --- a/arch/s390/kernel/vdso/vdso.lds.S
>> +++ b/arch/s390/kernel/vdso/vdso.lds.S
>> @@ -82,12 +82,16 @@ SECTIONS
>>    * We must supply the ELF program headers explicitly to get just one
>>    * PT_LOAD segment, and set the flags explicitly to make segments read-only.
>>    */
>> +#define PF_R    FLAGS(4)
>> +#define PF_RW    FLAGS(6)
>
> PF_RW seems to be unused
> Intel uses it for gnu_stack, which we don't seem to have.

Good catch, that slipped through.

I wondered whether we should also add a GNU_STACK PHDR in a separate
patch - similar to x86 and for the same reasons, as some of the .o files
linked into vdso.so do have a .note.GNU-stack.

> Anyway:
>
> Reviewed-by: Ilya Leoshkevich <iii@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/