diff options
-rw-r--r-- | fs/binfmt_flat.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/binfmt_flat.c b/fs/binfmt_flat.c index f0cd67d9d31b..c8998dc66882 100644 --- a/fs/binfmt_flat.c +++ b/fs/binfmt_flat.c | |||
@@ -520,7 +520,7 @@ static int load_flat_file(struct linux_binprm * bprm, | |||
520 | DBG_FLT("BINFMT_FLAT: ROM mapping of file (we hope)\n"); | 520 | DBG_FLT("BINFMT_FLAT: ROM mapping of file (we hope)\n"); |
521 | 521 | ||
522 | down_write(¤t->mm->mmap_sem); | 522 | down_write(¤t->mm->mmap_sem); |
523 | textpos = do_mmap(bprm->file, 0, text_len, PROT_READ|PROT_EXEC, 0, 0); | 523 | textpos = do_mmap(bprm->file, 0, text_len, PROT_READ|PROT_EXEC, MAP_SHARED, 0); |
524 | up_write(¤t->mm->mmap_sem); | 524 | up_write(¤t->mm->mmap_sem); |
525 | if (!textpos || textpos >= (unsigned long) -4096) { | 525 | if (!textpos || textpos >= (unsigned long) -4096) { |
526 | if (!textpos) | 526 | if (!textpos) |
@@ -532,7 +532,7 @@ static int load_flat_file(struct linux_binprm * bprm, | |||
532 | down_write(¤t->mm->mmap_sem); | 532 | down_write(¤t->mm->mmap_sem); |
533 | realdatastart = do_mmap(0, 0, data_len + extra + | 533 | realdatastart = do_mmap(0, 0, data_len + extra + |
534 | MAX_SHARED_LIBS * sizeof(unsigned long), | 534 | MAX_SHARED_LIBS * sizeof(unsigned long), |
535 | PROT_READ|PROT_WRITE|PROT_EXEC, 0, 0); | 535 | PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE, 0); |
536 | up_write(¤t->mm->mmap_sem); | 536 | up_write(¤t->mm->mmap_sem); |
537 | 537 | ||
538 | if (realdatastart == 0 || realdatastart >= (unsigned long)-4096) { | 538 | if (realdatastart == 0 || realdatastart >= (unsigned long)-4096) { |
@@ -574,7 +574,7 @@ static int load_flat_file(struct linux_binprm * bprm, | |||
574 | down_write(¤t->mm->mmap_sem); | 574 | down_write(¤t->mm->mmap_sem); |
575 | textpos = do_mmap(0, 0, text_len + data_len + extra + | 575 | textpos = do_mmap(0, 0, text_len + data_len + extra + |
576 | MAX_SHARED_LIBS * sizeof(unsigned long), | 576 | MAX_SHARED_LIBS * sizeof(unsigned long), |
577 | PROT_READ | PROT_EXEC | PROT_WRITE, 0, 0); | 577 | PROT_READ | PROT_EXEC | PROT_WRITE, MAP_PRIVATE, 0); |
578 | up_write(¤t->mm->mmap_sem); | 578 | up_write(¤t->mm->mmap_sem); |
579 | if (!textpos || textpos >= (unsigned long) -4096) { | 579 | if (!textpos || textpos >= (unsigned long) -4096) { |
580 | if (!textpos) | 580 | if (!textpos) |