Without this, we may oops if the process exec()s and discards its
address space after we find_vma().
Signed-off-by: Nick Alcock <nick.alcock@oracle.com>
Acked-by: Kris Van Hees <kris.van.hees@oracle.com>
Reviewed-by: Shannon Nelson <shannon.nelson@oracle.com>
Orabug:
24977175
mm = get_task_mm(child);
files = get_files_struct(child);
+ down_read(&mm->mmap_sem);
vma = find_vma(mm, addr);
if (!vma || vma->vm_start > addr) {
fd_install(new_fd, vma->vm_file);
err:
+ up_read(&mm->mmap_sem);
put_files_struct(files);
mmput(mm);