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] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 8 Dec 2021 09:56:16 +0100
From:   Michal Hocko <mhocko@...e.com>
To:     Suren Baghdasaryan <surenb@...gle.com>
Cc:     Matthew Wilcox <willy@...radead.org>, akpm@...ux-foundation.org,
        rientjes@...gle.com, hannes@...xchg.org, guro@...com,
        riel@...riel.com, minchan@...nel.org, kirill@...temov.name,
        aarcange@...hat.com, christian@...uner.io, hch@...radead.org,
        oleg@...hat.com, david@...hat.com, jannh@...gle.com,
        shakeelb@...gle.com, luto@...nel.org, christian.brauner@...ntu.com,
        fweimer@...hat.com, jengelh@...i.de, timmurray@...gle.com,
        linux-mm@...ck.org, linux-kernel@...r.kernel.org,
        kernel-team@...roid.com
Subject: Re: [PATCH v3 1/2] mm: protect free_pgtables with mmap_lock write
 lock in exit_mmap

On Tue 07-12-21 15:08:19, Suren Baghdasaryan wrote:
> On Tue, Dec 7, 2021 at 2:47 PM Suren Baghdasaryan <surenb@...gle.com> wrote:
> >
> > On Tue, Dec 7, 2021 at 2:07 PM Matthew Wilcox <willy@...radead.org> wrote:
> > >
> > > On Tue, Dec 07, 2021 at 01:50:30PM -0800, Suren Baghdasaryan wrote:
> > > > - Added a comment for vm_operations_struct::close, documenting restriction for
> > > > taking mmap_lock in the callback, per Michal Hocko and Matthew Wilcox
> > >
> > > This should be a separate patch because it stands alone, but ...
> >
> > I thought about it and since it was relevant to the change in
> > remove_vma locking, I thought it would fit here. However, if you
> > insist on splitting it, I'll post it as a separate patch. Please let
> > me know.
> >
> > >
> > > >  struct vm_operations_struct {
> > > >       void (*open)(struct vm_area_struct * area);
> > > > +    /*
> > > > +     * Called with mmap_lock lock held for write from __split_vma and
> > > > +     * remove_vma, therefore should never take that lock.
> > > > +     */
> > >
> > > Your whitespace indentation is weird.  And it'd be nice to make this a
> > > kernel-doc comment (I know none of the others are, but that should be
> > > fixed too).  And naming the functions that call it is wrong too.
> > >
> > >         /**
> > >          * @close: Called when the VMA is being removed from the MM.
> > >          * Context: Caller holds mmap_lock.
> 
> BTW, is the caller always required to hold mmap_lock for write or it
> *might* hold it?

I would go with might

-- 
Michal Hocko
SUSE Labs

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ