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:   Thu, 27 Jul 2023 16:40:20 -0700
From:   Suren Baghdasaryan <surenb@...gle.com>
To:     Stephen Rothwell <sfr@...b.auug.org.au>
Cc:     Andrew Morton <akpm@...ux-foundation.org>,
        Jann Horn <jannh@...gle.com>,
        Linus Torvalds <torvalds@...ux-foundation.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Linux Next Mailing List <linux-next@...r.kernel.org>,
        "Matthew Wilcox (Oracle)" <willy@...radead.org>
Subject: Re: linux-next: manual merge of the mm tree with Linus' tree

On Thu, Jul 27, 2023 at 4:29 PM Stephen Rothwell <sfr@...b.auug.org.au> wrote:
>
> Hi all,
>
> On Fri, 28 Jul 2023 09:18:49 +1000 Stephen Rothwell <sfr@...b.auug.org.au> wrote:
> >
> > Today's linux-next merge of the mm tree got a conflict in:
> >
> >   mm/memory.c
> >
> > between commit:
> >
> >   657b5146955e ("mm: lock_vma_under_rcu() must check vma->anon_vma under vma lock")
> >
> > from Linus' tree and commits:
> >
> >   69f6bbd1317f ("mm: handle userfaults under VMA lock")
> >   a3bdf38e85aa ("mm: allow per-VMA locks on file-backed VMAs")
> >
> > from the mm tree.
> >
> > I fixed it up (I think, please check - see below) and can carry the fix
> > as necessary. This is now fixed as far as linux-next is concerned, but
> > any non trivial conflicts should be mentioned to your upstream
> > maintainer when your tree is submitted for merging.  You may also want
> > to consider cooperating with the maintainer of the conflicting tree to
> > minimise any particularly complex conflicts.
> >
> > --
> > Cheers,
> > Stephen Rothwell
> >
> > diff --cc mm/memory.c
> > index ca632b58f792,271982fab2b8..000000000000
> > --- a/mm/memory.c
> > +++ b/mm/memory.c
> > @@@ -5392,32 -5597,18 +5597,21 @@@ retry
> >       if (!vma)
> >               goto inval;
> >
> > -     /* Only anonymous and tcp vmas are supported for now */
> > -     if (!vma_is_anonymous(vma) && !vma_is_tcp(vma))
> >  -    /* find_mergeable_anon_vma uses adjacent vmas which are not locked */
> >  -    if (vma_is_anonymous(vma) && !vma->anon_vma)
> > --            goto inval;
> > --
> >       if (!vma_start_read(vma))
> >               goto inval;
> >
> >  +    /*
> >  +     * find_mergeable_anon_vma uses adjacent vmas which are not locked.
> >  +     * This check must happen after vma_start_read(); otherwise, a
> >  +     * concurrent mremap() with MREMAP_DONTUNMAP could dissociate the VMA
> >  +     * from its anon_vma.
> >  +     */
> > -     if (unlikely(!vma->anon_vma && !vma_is_tcp(vma)))
> > -             goto inval_end_read;
> > -
> > -     /*
> > -      * Due to the possibility of userfault handler dropping mmap_lock, avoid
> > -      * it for now and fall back to page fault handling under mmap_lock.
> > -      */
> > -     if (userfaultfd_armed(vma))
> > ++    if (unlikely(vma_is_anonymous(vma) && !vma_is_tcp(vma)))

Is the above extra '+' what compiler complains about?
Patches from Linus' tree remove some code from that function, so
applying them first should simplify the merge.

> >   657b5146955e ("mm: lock_vma_under_rcu() must check vma->anon_vma under vma lock")

> >  +            goto inval_end_read;
> >  +
> >       /* Check since vm_start/vm_end might change before we lock the VMA */
> >  -    if (unlikely(address < vma->vm_start || address >= vma->vm_end)) {
> >  -            vma_end_read(vma);
> >  -            goto inval;
> >  -    }
> >  +    if (unlikely(address < vma->vm_start || address >= vma->vm_end))
> >  +            goto inval_end_read;
> >
> >       /* Check if the VMA got isolated after we found it */
> >       if (vma->detached) {
>
> Sorry, doesn't even build ... let me try that again.
>
> --
> Cheers,
> Stephen Rothwell

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ