diff options
Diffstat (limited to 'fs/binfmt_elf_fdpic.c')
-rw-r--r-- | fs/binfmt_elf_fdpic.c | 35 |
1 files changed, 3 insertions, 32 deletions
diff --git a/fs/binfmt_elf_fdpic.c b/fs/binfmt_elf_fdpic.c index aa5b43205e37..f3e72c5c19f5 100644 --- a/fs/binfmt_elf_fdpic.c +++ b/fs/binfmt_elf_fdpic.c | |||
@@ -168,9 +168,6 @@ static int load_elf_fdpic_binary(struct linux_binprm *bprm, | |||
168 | struct elf_fdpic_params exec_params, interp_params; | 168 | struct elf_fdpic_params exec_params, interp_params; |
169 | struct elf_phdr *phdr; | 169 | struct elf_phdr *phdr; |
170 | unsigned long stack_size, entryaddr; | 170 | unsigned long stack_size, entryaddr; |
171 | #ifndef CONFIG_MMU | ||
172 | unsigned long fullsize; | ||
173 | #endif | ||
174 | #ifdef ELF_FDPIC_PLAT_INIT | 171 | #ifdef ELF_FDPIC_PLAT_INIT |
175 | unsigned long dynaddr; | 172 | unsigned long dynaddr; |
176 | #endif | 173 | #endif |
@@ -390,11 +387,6 @@ static int load_elf_fdpic_binary(struct linux_binprm *bprm, | |||
390 | goto error_kill; | 387 | goto error_kill; |
391 | } | 388 | } |
392 | 389 | ||
393 | /* expand the stack mapping to use up the entire allocation granule */ | ||
394 | fullsize = kobjsize((char *) current->mm->start_brk); | ||
395 | if (!IS_ERR_VALUE(do_mremap(current->mm->start_brk, stack_size, | ||
396 | fullsize, 0, 0))) | ||
397 | stack_size = fullsize; | ||
398 | up_write(¤t->mm->mmap_sem); | 390 | up_write(¤t->mm->mmap_sem); |
399 | 391 | ||
400 | current->mm->brk = current->mm->start_brk; | 392 | current->mm->brk = current->mm->start_brk; |
@@ -1567,11 +1559,9 @@ end_coredump: | |||
1567 | static int elf_fdpic_dump_segments(struct file *file, size_t *size, | 1559 | static int elf_fdpic_dump_segments(struct file *file, size_t *size, |
1568 | unsigned long *limit, unsigned long mm_flags) | 1560 | unsigned long *limit, unsigned long mm_flags) |
1569 | { | 1561 | { |
1570 | struct vm_list_struct *vml; | 1562 | struct vm_area_struct *vma; |
1571 | |||
1572 | for (vml = current->mm->context.vmlist; vml; vml = vml->next) { | ||
1573 | struct vm_area_struct *vma = vml->vma; | ||
1574 | 1563 | ||
1564 | for (vma = current->mm->mmap; vma; vma = vma->vm_next) { | ||
1575 | if (!maydump(vma, mm_flags)) | 1565 | if (!maydump(vma, mm_flags)) |
1576 | continue; | 1566 | continue; |
1577 | 1567 | ||
@@ -1617,9 +1607,6 @@ static int elf_fdpic_core_dump(long signr, struct pt_regs *regs, | |||
1617 | elf_fpxregset_t *xfpu = NULL; | 1607 | elf_fpxregset_t *xfpu = NULL; |
1618 | #endif | 1608 | #endif |
1619 | int thread_status_size = 0; | 1609 | int thread_status_size = 0; |
1620 | #ifndef CONFIG_MMU | ||
1621 | struct vm_list_struct *vml; | ||
1622 | #endif | ||
1623 | elf_addr_t *auxv; | 1610 | elf_addr_t *auxv; |
1624 | unsigned long mm_flags; | 1611 | unsigned long mm_flags; |
1625 | 1612 | ||
@@ -1685,13 +1672,7 @@ static int elf_fdpic_core_dump(long signr, struct pt_regs *regs, | |||
1685 | fill_prstatus(prstatus, current, signr); | 1672 | fill_prstatus(prstatus, current, signr); |
1686 | elf_core_copy_regs(&prstatus->pr_reg, regs); | 1673 | elf_core_copy_regs(&prstatus->pr_reg, regs); |
1687 | 1674 | ||
1688 | #ifdef CONFIG_MMU | ||
1689 | segs = current->mm->map_count; | 1675 | segs = current->mm->map_count; |
1690 | #else | ||
1691 | segs = 0; | ||
1692 | for (vml = current->mm->context.vmlist; vml; vml = vml->next) | ||
1693 | segs++; | ||
1694 | #endif | ||
1695 | #ifdef ELF_CORE_EXTRA_PHDRS | 1676 | #ifdef ELF_CORE_EXTRA_PHDRS |
1696 | segs += ELF_CORE_EXTRA_PHDRS; | 1677 | segs += ELF_CORE_EXTRA_PHDRS; |
1697 | #endif | 1678 | #endif |
@@ -1766,20 +1747,10 @@ static int elf_fdpic_core_dump(long signr, struct pt_regs *regs, | |||
1766 | mm_flags = current->mm->flags; | 1747 | mm_flags = current->mm->flags; |
1767 | 1748 | ||
1768 | /* write program headers for segments dump */ | 1749 | /* write program headers for segments dump */ |
1769 | for ( | 1750 | for (vma = current->mm->mmap; vma; vma = vma->vm_next) { |
1770 | #ifdef CONFIG_MMU | ||
1771 | vma = current->mm->mmap; vma; vma = vma->vm_next | ||
1772 | #else | ||
1773 | vml = current->mm->context.vmlist; vml; vml = vml->next | ||
1774 | #endif | ||
1775 | ) { | ||
1776 | struct elf_phdr phdr; | 1751 | struct elf_phdr phdr; |
1777 | size_t sz; | 1752 | size_t sz; |
1778 | 1753 | ||
1779 | #ifndef CONFIG_MMU | ||
1780 | vma = vml->vma; | ||
1781 | #endif | ||
1782 | |||
1783 | sz = vma->vm_end - vma->vm_start; | 1754 | sz = vma->vm_end - vma->vm_start; |
1784 | 1755 | ||
1785 | phdr.p_type = PT_LOAD; | 1756 | phdr.p_type = PT_LOAD; |