The current code will load the stack size and markings, but then only use
the markings in the MMU code path.  The NOMMU code path always passes EXEC
to the mmap() call.  While this doesn't matter to most people during the
run of the code, it causes a pointless icache flush when starting every
FDPIC application and by default, that tends to be 128kB of waste.

Signed-off-by: Mike Frysinger <vap...@gentoo.org>
---
note: this will apply cleanly with the uninitialized flag patch applied,
but otherwise doesn't directly depend on it

 fs/binfmt_elf_fdpic.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/fs/binfmt_elf_fdpic.c b/fs/binfmt_elf_fdpic.c
index 8563a57..3e2507b 100644
--- a/fs/binfmt_elf_fdpic.c
+++ b/fs/binfmt_elf_fdpic.c
@@ -380,7 +380,8 @@ static int load_elf_fdpic_binary(struct linux_binprm *bprm,
 
        down_write(&current->mm->mmap_sem);
        current->mm->start_brk = do_mmap(NULL, 0, stack_size,
-                                        PROT_READ | PROT_WRITE | PROT_EXEC,
+                                        PROT_READ | PROT_WRITE |
+                                        (executable_stack & EXSTACK_ENABLE_X ? 
PROT_EXEC : 0),
                                         MAP_PRIVATE | MAP_ANONYMOUS |
                                         MAP_UNINITIALIZED | MAP_GROWSDOWN,
                                         0);
-- 
1.6.5.3

_______________________________________________
uClinux-dev mailing list
uClinux-dev@uclinux.org
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by uclinux-dev@uclinux.org
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev

Reply via email to