[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200821130337.f4d1f5cd665ab149e1f43ed5@linux-foundation.org>
Date: Fri, 21 Aug 2020 13:03:37 -0700
From: Andrew Morton <akpm@...ux-foundation.org>
To: Yang Shi <shy828301@...il.com>
Cc: syzbot <syzbot+b90df26038d1d5d85c97@...kaller.appspotmail.com>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Linux MM <linux-mm@...ck.org>, syzkaller-bugs@...glegroups.com,
Jan Kara <jack@...e.cz>
Subject: Re: KASAN: use-after-free Read in do_madvise
On Fri, 21 Aug 2020 10:15:45 -0700 Yang Shi <shy828301@...il.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!
Powered by blists - more mailing lists