Commit b312379d authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] misc fixes

- Fix dead comment in load_elf_interp() (Dave Airlie)

- Add some (hard-won) commentary around the early SET_PERSONALITY() in
  load_elf_binary().

- Remove dead hugetlb prototype.

- Fix some silliness in hugetlbpage.c
parent 0e5e99a9
......@@ -283,8 +283,8 @@ int try_to_free_low(int count)
break;
}
page = list_entry(p, struct page, list);
if ((page_zone(page))->name[0] != 'H') // Look for non-Highmem
map = page;
if (!PageHighMem(page))
map = page;
}
if (map) {
list_del(&map->list);
......
......@@ -362,8 +362,6 @@ static unsigned long load_elf_interp(struct elfhdr * interp_elf_ex,
}
}
/* Now use mmap to map the library into memory. */
/*
* Now fill out the bss section. First pad the last page up
* to the page boundary, and then perform a mmap to make sure
......@@ -536,6 +534,25 @@ static int load_elf_binary(struct linux_binprm * bprm, struct pt_regs * regs)
strcmp(elf_interpreter,"/usr/lib/ld.so.1") == 0)
ibcs2_interpreter = 1;
/*
* The early SET_PERSONALITY here is so that the lookup
* for the interpreter happens in the namespace of the
* to-be-execed image. SET_PERSONALITY can select an
* alternate root.
*
* However, SET_PERSONALITY is NOT allowed to switch
* this task into the new images's memory mapping
* policy - that is, TASK_SIZE must still evaluate to
* that which is appropriate to the execing application.
* This is because exit_mmap() needs to have TASK_SIZE
* evaluate to the size of the old image.
*
* So if (say) a 64-bit application is execing a 32-bit
* application it is the architecture's responsibility
* to defer changing the value of TASK_SIZE until the
* switch really is going to happen - do this in
* flush_thread(). - akpm
*/
SET_PERSONALITY(elf_ex, ibcs2_interpreter);
interpreter = open_exec(elf_interpreter);
......
......@@ -18,7 +18,6 @@ void zap_hugepage_range(struct vm_area_struct *, unsigned long, unsigned long);
void unmap_hugepage_range(struct vm_area_struct *, unsigned long, unsigned long);
int hugetlb_prefault(struct address_space *, struct vm_area_struct *);
void huge_page_release(struct page *);
void hugetlb_release_key(struct hugetlb_key *);
int hugetlb_report_meminfo(char *);
int is_hugepage_mem_enough(size_t);
......
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