From 2059409892620b5b84c65ce7939f9ca423be43de Mon Sep 17 00:00:00 2001 From: Eric Andersen Date: Thu, 13 May 2004 00:19:47 +0000 Subject: Bradley D. LaRonde writes: Oops, this adds the page alignment offset to the mprotected size. Regards, Brad --- ldso/ldso/dl-startup.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'ldso') 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); } -- cgit v1.2.3