Skip to content

Commit

Permalink
[PATCH] uclinux: use MAP_PRIVATE when mmaping code regions in flat bi…
Browse files Browse the repository at this point in the history
…nary loader

Use MAP_PRIVATE when calling mmap to get memory for the code region.
The flat loader was using MAP_SHARED, but underlying changes to the
MMUless mmap means this is now wrong.

Signed-off-by: Greg Ungerer <gerg@uclinux.com>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Greg Ungerer authored and Linus Torvalds committed Sep 2, 2005
1 parent 03a002e commit 213b24c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/binfmt_flat.c
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,7 @@ static int load_flat_file(struct linux_binprm * bprm,
DBG_FLT("BINFMT_FLAT: ROM mapping of file (we hope)\n");

down_write(&current->mm->mmap_sem);
textpos = do_mmap(bprm->file, 0, text_len, PROT_READ|PROT_EXEC, MAP_SHARED, 0);
textpos = do_mmap(bprm->file, 0, text_len, PROT_READ|PROT_EXEC, MAP_PRIVATE, 0);
up_write(&current->mm->mmap_sem);
if (!textpos || textpos >= (unsigned long) -4096) {
if (!textpos)
Expand Down

0 comments on commit 213b24c

Please sign in to comment.