summaryrefslogtreecommitdiff
path: root/libexec/ld.so/arm
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2022-11-09 18:39:36 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2022-11-09 18:39:36 +0000
commit670b414f2bff996a276a3542f500b896d265d474 (patch)
treeaa52a61657910d3d214f1dba7cf54e7cdfd3b8c4 /libexec/ld.so/arm
parentf4b00e1678be3e35e20ee412a8c3e37f5109587a (diff)
Since the introduction of automatic immutable from the kernel, the munmap()
of ld.so boot.text region is now (silently) failing because the region is contained within the text LOAD, which is immutable. So create a new btext LOAD with flags PF_X|PF_R|PF_OPENBSD_MUTABLE, and place all boot.text objects in there. This LOAD must also be page-aligned so it doesn't skip unmapping some of the object region, previously it was hilariously unaligned. ok kettenis and guenther seemed to like it also This one is for 32-bit arm, tested by phessler
Diffstat (limited to 'libexec/ld.so/arm')
-rw-r--r--libexec/ld.so/arm/ld.script5
1 files changed, 4 insertions, 1 deletions
diff --git a/libexec/ld.so/arm/ld.script b/libexec/ld.so/arm/ld.script
index f18abe07795..ae7cc098ef0 100644
--- a/libexec/ld.so/arm/ld.script
+++ b/libexec/ld.so/arm/ld.script
@@ -2,6 +2,7 @@ PHDRS
{
rodata PT_LOAD FILEHDR PHDRS FLAGS (4);
text PT_LOAD;
+ btext PT_LOAD FLAGS (0x08000005);
data PT_LOAD;
random PT_OPENBSD_RANDOMIZE;
relro PT_GNU_RELRO;
@@ -26,10 +27,12 @@ SECTIONS
. = ALIGN(0x1000);
.boot.text :
{
+ . = ALIGN(0x1000);
boot_text_start = .;
*(.boot.text)
+ . = ALIGN(0x1000);
boot_text_end = .;
- } :text
+ } :btext
/* RELRO DATA */
. = DATA_SEGMENT_ALIGN (0x10000, 0x1000);