summaryrefslogtreecommitdiff
path: root/libexec/ld.so/sh
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2016-06-21 15:25:39 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2016-06-21 15:25:39 +0000
commit4f908dbab81e31a5ed85d33cfc5f13efa43a042f (patch)
treec2120b73bc474bea02b95aa6027a5a7e6f3f9163 /libexec/ld.so/sh
parent7e69dbfca45ff61a2865b4132a3ba615e1291693 (diff)
When handling DT_TEXTREL only set the mapping to READ+WRITE, ignore
possible EXEC permission for the section, because the proper permission is set late, and there are no thread concerns here. Avoids W^X issues in oddball cases. ok guenther kettenis
Diffstat (limited to 'libexec/ld.so/sh')
-rw-r--r--libexec/ld.so/sh/rtld_machine.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libexec/ld.so/sh/rtld_machine.c b/libexec/ld.so/sh/rtld_machine.c
index 850eec26861..9a334f2742b 100644
--- a/libexec/ld.so/sh/rtld_machine.c
+++ b/libexec/ld.so/sh/rtld_machine.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rtld_machine.c,v 1.23 2015/11/02 07:02:53 guenther Exp $ */
+/* $OpenBSD: rtld_machine.c,v 1.24 2016/06/21 15:25:38 deraadt Exp $ */
/*
* Copyright (c) 2004 Dale Rahn
@@ -632,7 +632,7 @@ _dl_md_reloc(elf_object_t *object, int rel, int relasz)
llist = llist->next) {
if (!(llist->prot & PROT_WRITE))
_dl_mprotect(llist->start, llist->size,
- llist->prot|PROT_WRITE);
+ PROT_READ | PROT_WRITE);
}
}