From 6e17a45b3cf0694d50d05e1159ca700ae342099e Mon Sep 17 00:00:00 2001 From: Jens Remus Date: Mon, 13 Jul 2026 16:42:31 +0200 Subject: [PATCH] s390/vdso: Use symbolic constants for the PHDR permission flags 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"). Reviewed-by: Ilya Leoshkevich Acked-by: Heiko Carstens Signed-off-by: Jens Remus Signed-off-by: Vasily Gorbik --- arch/s390/kernel/vdso/vdso.lds.S | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/arch/s390/kernel/vdso/vdso.lds.S b/arch/s390/kernel/vdso/vdso.lds.S index 7bec4de0e8e0..841daeec4be2 100644 --- a/arch/s390/kernel/vdso/vdso.lds.S +++ b/arch/s390/kernel/vdso/vdso.lds.S @@ -82,12 +82,15 @@ 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_RX FLAGS(5) + PHDRS { - text PT_LOAD FILEHDR PHDRS FLAGS(5); /* PF_R|PF_X */ - dynamic PT_DYNAMIC FLAGS(4); /* PF_R */ - note PT_NOTE FLAGS(4); /* PF_R */ - eh_frame_hdr PT_GNU_EH_FRAME; + text PT_LOAD PF_RX FILEHDR PHDRS; + dynamic PT_DYNAMIC PF_R; + note PT_NOTE PF_R; + eh_frame_hdr PT_GNU_EH_FRAME PF_R; } /*