lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Tue, 15 Feb 2022 12:30:12 -0800
From:   Suren Baghdasaryan <surenb@...gle.com>
To:     Michal Hocko <mhocko@...e.com>
Cc:     Yang Shi <shy828301@...il.com>,
        syzbot <syzbot+2ccf63a4bd07cf39cab0@...kaller.appspotmail.com>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Christian Brauner <brauner@...nel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Linux MM <linux-mm@...ck.org>,
        syzkaller-bugs <syzkaller-bugs@...glegroups.com>
Subject: Re: [syzbot] KASAN: use-after-free Read in __oom_reap_task_mm

On Tue, Feb 15, 2022 at 11:43 AM Suren Baghdasaryan <surenb@...gle.com> wrote:
>
> On Tue, Feb 15, 2022 at 11:36 AM Michal Hocko <mhocko@...e.com> wrote:
> >
> > On Tue 15-02-22 10:10:53, Suren Baghdasaryan wrote:
> > > On Tue, Feb 15, 2022 at 9:53 AM Yang Shi <shy828301@...il.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?
>
> Doh! Yes, it looks like I completely missed the actual pointer. That
> must be it since I don't see any other possibility. Will post a patch
> shortly.

Fix posted at https://lore.kernel.org/all/20220215201922.1908156-1-surenb@google.com/

> Thanks!
>
> > --
> > Michal Hocko
> > SUSE Labs

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ