diff options
Diffstat (limited to 'fs/binfmt_flat.c')
-rw-r--r-- | fs/binfmt_flat.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/fs/binfmt_flat.c b/fs/binfmt_flat.c index 024d20ee3ca3..6b2daf99fab8 100644 --- a/fs/binfmt_flat.c +++ b/fs/binfmt_flat.c | |||
@@ -542,10 +542,8 @@ static int load_flat_file(struct linux_binprm * bprm, | |||
542 | */ | 542 | */ |
543 | DBG_FLT("BINFMT_FLAT: ROM mapping of file (we hope)\n"); | 543 | DBG_FLT("BINFMT_FLAT: ROM mapping of file (we hope)\n"); |
544 | 544 | ||
545 | down_write(¤t->mm->mmap_sem); | 545 | textpos = vm_mmap(bprm->file, 0, text_len, PROT_READ|PROT_EXEC, |
546 | textpos = do_mmap(bprm->file, 0, text_len, PROT_READ|PROT_EXEC, | ||
547 | MAP_PRIVATE|MAP_EXECUTABLE, 0); | 546 | MAP_PRIVATE|MAP_EXECUTABLE, 0); |
548 | up_write(¤t->mm->mmap_sem); | ||
549 | if (!textpos || IS_ERR_VALUE(textpos)) { | 547 | if (!textpos || IS_ERR_VALUE(textpos)) { |
550 | if (!textpos) | 548 | if (!textpos) |
551 | textpos = (unsigned long) -ENOMEM; | 549 | textpos = (unsigned long) -ENOMEM; |
@@ -556,10 +554,8 @@ static int load_flat_file(struct linux_binprm * bprm, | |||
556 | 554 | ||
557 | len = data_len + extra + MAX_SHARED_LIBS * sizeof(unsigned long); | 555 | len = data_len + extra + MAX_SHARED_LIBS * sizeof(unsigned long); |
558 | len = PAGE_ALIGN(len); | 556 | len = PAGE_ALIGN(len); |
559 | down_write(¤t->mm->mmap_sem); | 557 | realdatastart = vm_mmap(0, 0, len, |
560 | realdatastart = do_mmap(0, 0, len, | ||
561 | PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE, 0); | 558 | PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE, 0); |
562 | up_write(¤t->mm->mmap_sem); | ||
563 | 559 | ||
564 | if (realdatastart == 0 || IS_ERR_VALUE(realdatastart)) { | 560 | if (realdatastart == 0 || IS_ERR_VALUE(realdatastart)) { |
565 | if (!realdatastart) | 561 | if (!realdatastart) |
@@ -603,10 +599,8 @@ static int load_flat_file(struct linux_binprm * bprm, | |||
603 | 599 | ||
604 | len = text_len + data_len + extra + MAX_SHARED_LIBS * sizeof(unsigned long); | 600 | len = text_len + data_len + extra + MAX_SHARED_LIBS * sizeof(unsigned long); |
605 | len = PAGE_ALIGN(len); | 601 | len = PAGE_ALIGN(len); |
606 | down_write(¤t->mm->mmap_sem); | 602 | textpos = vm_mmap(0, 0, len, |
607 | textpos = do_mmap(0, 0, len, | ||
608 | PROT_READ | PROT_EXEC | PROT_WRITE, MAP_PRIVATE, 0); | 603 | PROT_READ | PROT_EXEC | PROT_WRITE, MAP_PRIVATE, 0); |
609 | up_write(¤t->mm->mmap_sem); | ||
610 | 604 | ||
611 | if (!textpos || IS_ERR_VALUE(textpos)) { | 605 | if (!textpos || IS_ERR_VALUE(textpos)) { |
612 | if (!textpos) | 606 | if (!textpos) |