From 646d7ab12b8d69f7fc3d744a9e131304af504f2b Mon Sep 17 00:00:00 2001 From: Robert O'Callahan Date: Sat, 17 Aug 2024 15:41:58 +1200 Subject: [PATCH] Make `PT_LOAD` explicitly read-execute and `PT_DYNAMIC` explicitly read-only When we make `librrpage.so` non-absolutely positioned, the dynamic loader will try to relocate `PT_DYNAMIC` if it's not marked read-only. The kernel's VDSO has readonly `PT_DYNAMIC` so we're matching that. --- src/preload/rr_page.ld.in | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/preload/rr_page.ld.in b/src/preload/rr_page.ld.in index ca1db312fde..3f5cf6e1a8c 100644 --- a/src/preload/rr_page.ld.in +++ b/src/preload/rr_page.ld.in @@ -1,9 +1,9 @@ PHDRS { - text PT_LOAD FILEHDR PHDRS; - dynamic PT_DYNAMIC ; - note PT_NOTE ; - eh_frame 0x6474e550 ; + text PT_LOAD FLAGS(5) FILEHDR PHDRS; + dynamic PT_DYNAMIC FLAGS(4); + note PT_NOTE FLAGS(4); + eh_frame 0x6474e550; replay PT_NULL; } SECTIONS