lkml.org 
[lkml]   [2020]   [Aug]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: KASAN: use-after-free Read in do_madvise
On Fri, 21 Aug 2020 10:15:45 -0700 Yang Shi <shy828301@gmail.com> wrote:

> It looks the vma is gone. The below patch should be able to fix it:
>
> diff --git a/mm/madvise.c b/mm/madvise.c
> index dd1d43cf026d..d4aa5f776543 100644
> --- a/mm/madvise.c
> +++ b/mm/madvise.c
> @@ -289,9 +289,9 @@ static long madvise_willneed(struct vm_area_struct *vma,
> */
> *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);

Oh geeze. Can you please send this along as a real patch, cc:stable,
Fixes: 692fe62433d4c? Please cc Jan!

\
 
 \ /
  Last update: 2020-08-21 22:05    [W:0.066 / U:0.028 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site