summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2004-05-13 00:19:47 +0000
committerEric Andersen <andersen@codepoet.org>2004-05-13 00:19:47 +0000
commit2059409892620b5b84c65ce7939f9ca423be43de (patch)
tree59f36e5b0d7b37826d431ec2fbf6544c7b4a0ce0
parent8525fd1b9781796c8ccd560f777a5e41c2de7d8b (diff)
Bradley D. LaRonde writes:
Oops, this adds the page alignment offset to the mprotected size. Regards, Brad
-rw-r--r--ldso/ldso/dl-startup.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/ldso/ldso/dl-startup.c b/ldso/ldso/dl-startup.c
index 9b6ef76c6..f97619af3 100644
--- a/ldso/ldso/dl-startup.c
+++ b/ldso/ldso/dl-startup.c
@@ -383,7 +383,8 @@ found_got:
* it to us rx.
*/
Elf32_Addr mpa = (ppnt->p_vaddr + app_tpnt->loadaddr) & ~(_dl_pagesize - 1);
- if(_dl_mprotect(mpa, ppnt->p_memsz, PROT_READ | PROT_WRITE | PROT_EXEC)) {
+ Elf32_Word mps = ((ppnt->p_vaddr + app_tpnt->loadaddr) - mpa) + ppnt->p_memsz;
+ if(_dl_mprotect(mpa, mps, PROT_READ | PROT_WRITE | PROT_EXEC)) {
SEND_STDERR("Couldn't mprotect .dynamic segment to rwx.\n");
_dl_exit(0);
}