Commit 22a5dad8 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] Fix elf mapping of the zero page

From: William Lee Irwin III <wli@holomorphy.com>

Using PAGE_SIZE rather than 4096 so that mmap() granularity is honored by
whatever non-i386 architectures use MMAP_PAGE_ZERO.
parent d398efb9
...@@ -830,9 +830,8 @@ static int load_elf_binary(struct linux_binprm * bprm, struct pt_regs * regs) ...@@ -830,9 +830,8 @@ static int load_elf_binary(struct linux_binprm * bprm, struct pt_regs * regs)
and some applications "depend" upon this behavior. and some applications "depend" upon this behavior.
Since we do not have the power to recompile these, we Since we do not have the power to recompile these, we
emulate the SVr4 behavior. Sigh. */ emulate the SVr4 behavior. Sigh. */
/* N.B. Shouldn't the size here be PAGE_SIZE?? */
down_write(&current->mm->mmap_sem); down_write(&current->mm->mmap_sem);
error = do_mmap(NULL, 0, 4096, PROT_READ | PROT_EXEC, error = do_mmap(NULL, 0, PAGE_SIZE, PROT_READ | PROT_EXEC,
MAP_FIXED | MAP_PRIVATE, 0); MAP_FIXED | MAP_PRIVATE, 0);
up_write(&current->mm->mmap_sem); up_write(&current->mm->mmap_sem);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment