aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2012-05-30 01:49:38 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2012-05-30 21:04:55 -0400
commit5a5e4c2eca0307deeb438c97dbdc608663515c0a (patch)
tree324a5204b4fb315b5a7f9dda0739b6524e93a55b
parent63d37a84ab6004c235314ffd7a76c5eb28c2fae0 (diff)
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>
-rw-r--r--fs/binfmt_elf.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c
index e658dd134b95..1b52956afe33 100644
--- a/fs/binfmt_elf.c
+++ b/fs/binfmt_elf.c
@@ -329,7 +329,6 @@ static unsigned long elf_map(struct file *filep, unsigned long addr,
329 if (!size) 329 if (!size)
330 return addr; 330 return addr;
331 331
332 down_write(&current->mm->mmap_sem);
333 /* 332 /*
334 * total_size is the size of the ELF (interpreter) image. 333 * total_size is the size of the ELF (interpreter) image.
335 * The _first_ mmap needs to know the full size, otherwise 334 * 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,
340 */ 339 */
341 if (total_size) { 340 if (total_size) {
342 total_size = ELF_PAGEALIGN(total_size); 341 total_size = ELF_PAGEALIGN(total_size);
343 map_addr = do_mmap(filep, addr, total_size, prot, type, off); 342 map_addr = vm_mmap(filep, addr, total_size, prot, type, off);
344 if (!BAD_ADDR(map_addr)) 343 if (!BAD_ADDR(map_addr))
345 do_munmap(current->mm, map_addr+size, total_size-size); 344 vm_munmap(map_addr+size, total_size-size);
346 } else 345 } else
347 map_addr = do_mmap(filep, addr, size, prot, type, off); 346 map_addr = vm_mmap(filep, addr, size, prot, type, off);
348 347
349 up_write(&current->mm->mmap_sem);
350 return(map_addr); 348 return(map_addr);
351} 349}
352 350