mirror of
https://github.com/followmsi/android_kernel_google_msm.git
synced 2024-11-06 23:17:41 +00:00
binfmt_elf: switch elf_map() to vm_mmap/vm_munmap
No reason to hold ->mmap_sem over the sequence Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
This commit is contained in:
parent
63d37a84ab
commit
5a5e4c2eca
1 changed files with 3 additions and 5 deletions
|
@ -329,7 +329,6 @@ static unsigned long elf_map(struct file *filep, unsigned long addr,
|
||||||
if (!size)
|
if (!size)
|
||||||
return addr;
|
return addr;
|
||||||
|
|
||||||
down_write(¤t->mm->mmap_sem);
|
|
||||||
/*
|
/*
|
||||||
* total_size is the size of the ELF (interpreter) image.
|
* total_size is the size of the ELF (interpreter) image.
|
||||||
* The _first_ mmap needs to know the full size, otherwise
|
* The _first_ mmap needs to know the full size, otherwise
|
||||||
|
@ -340,13 +339,12 @@ static unsigned long elf_map(struct file *filep, unsigned long addr,
|
||||||
*/
|
*/
|
||||||
if (total_size) {
|
if (total_size) {
|
||||||
total_size = ELF_PAGEALIGN(total_size);
|
total_size = ELF_PAGEALIGN(total_size);
|
||||||
map_addr = do_mmap(filep, addr, total_size, prot, type, off);
|
map_addr = vm_mmap(filep, addr, total_size, prot, type, off);
|
||||||
if (!BAD_ADDR(map_addr))
|
if (!BAD_ADDR(map_addr))
|
||||||
do_munmap(current->mm, map_addr+size, total_size-size);
|
vm_munmap(map_addr+size, total_size-size);
|
||||||
} else
|
} else
|
||||||
map_addr = do_mmap(filep, addr, size, prot, type, off);
|
map_addr = vm_mmap(filep, addr, size, prot, type, off);
|
||||||
|
|
||||||
up_write(¤t->mm->mmap_sem);
|
|
||||||
return(map_addr);
|
return(map_addr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue