From: Michal Hocko <mhocko@suse.com>
To: Suren Baghdasaryan <surenb@google.com>
Cc: Yang Shi <shy828301@gmail.com>,
syzbot <syzbot+2ccf63a4bd07cf39cab0@syzkaller.appspotmail.com>,
Andrew Morton <akpm@linux-foundation.org>,
Christian Brauner <brauner@kernel.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Linux MM <linux-mm@kvack.org>,
syzkaller-bugs <syzkaller-bugs@googlegroups.com>
Subject: Re: [syzbot] KASAN: use-after-free Read in __oom_reap_task_mm
Date: Tue, 15 Feb 2022 20:36:05 +0100 [thread overview]
Message-ID: <YgwApdvLhxFU26j5@dhcp22.suse.cz> (raw)
In-Reply-To: <CAJuCfpE833u+Z909yaLgGEJV7O10fVw-_eG1nH=w4b3+PbxrLg@mail.gmail.com>
On Tue 15-02-22 10:10:53, Suren Baghdasaryan wrote:
> On Tue, Feb 15, 2022 at 9:53 AM Yang Shi <shy828301@gmail.com> wrote:
[...]
> > Isn't the below race possible?
> >
> > CPU A CPU B
> > exiting:
> > mmap_write_lock
> > remove_vma()
> > mmap_write_unlock
> > process_mrelease:
> > mmap_read_lock
> > __oom_reap_task_mm
> > mmap_read_unlock
> >
>
> Sure, that sequence (would not call it a race) is possible but in this
> case __oom_reap_task_mm will find no vmas in the mm because exit_mmap
> freed and removed all of them.
I didn't really have chance to have a closer look but I do not see
exit_mmap doing mm->mmap = NULL so the pointer can be a freed vma unless
I am missing something. I thought we've had it in your patches? Has this
got lost somewhere in the process?
--
Michal Hocko
SUSE Labs
next prev parent reply other threads:[~2022-02-15 19:36 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-14 10:44 [syzbot] KASAN: use-after-free Read in __oom_reap_task_mm syzbot
2022-02-14 19:07 ` Yang Shi
2022-02-15 9:59 ` Michal Hocko
2022-02-15 17:34 ` Suren Baghdasaryan
2022-02-15 17:53 ` Yang Shi
2022-02-15 18:10 ` Suren Baghdasaryan
2022-02-15 19:36 ` Michal Hocko [this message]
2022-02-15 19:43 ` Suren Baghdasaryan
2022-02-15 20:30 ` Suren Baghdasaryan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YgwApdvLhxFU26j5@dhcp22.suse.cz \
--to=mhocko@suse.com \
--cc=akpm@linux-foundation.org \
--cc=brauner@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=shy828301@gmail.com \
--cc=surenb@google.com \
--cc=syzbot+2ccf63a4bd07cf39cab0@syzkaller.appspotmail.com \
--cc=syzkaller-bugs@googlegroups.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).