Message ID | 20200904233555.nMt3agulD%akpm@linux-foundation.org |
---|---|
State | New |
Headers | show |
Series | None | expand |
--- a/mm/madvise.c~mm-madvise-fix-vma-user-after-free +++ a/mm/madvise.c @@ -289,9 +289,9 @@ static long madvise_willneed(struct vm_a */ *prev = NULL; /* tell sys_madvise we drop mmap_lock */ get_file(file); - mmap_read_unlock(current->mm); offset = (loff_t)(start - vma->vm_start) + ((loff_t)vma->vm_pgoff << PAGE_SHIFT); + mmap_read_unlock(current->mm); vfs_fadvise(file, offset, end - start, POSIX_FADV_WILLNEED); fput(file); mmap_read_lock(current->mm);