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, 10 Oct 2018 19:38:57 +0200
From:   Michal Hocko <mhocko@...nel.org>
To:     Jann Horn <jannh@...gle.com>
Cc:     Linux-MM <linux-mm@...ck.org>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Khalid Aziz <khalid.aziz@...cle.com>,
        Michael Ellerman <mpe@...erman.id.au>,
        Russell King - ARM Linux <linux@...linux.org.uk>,
        Andrea Arcangeli <aarcange@...hat.com>,
        Florian Weimer <fweimer@...hat.com>,
        John Hubbard <jhubbard@...dia.com>,
        Matthew Wilcox <willy@...radead.org>,
        abdhalee@...ux.vnet.ibm.com, joel@....id.au,
        Kees Cook <keescook@...omium.org>, jasone@...gle.com,
        davidtgoldblatt@...il.com, trasz@...ebsd.org,
        Anshuman Khandual <khandual@...ux.vnet.ibm.com>,
        Daniel Micay <danielmicay@...il.com>,
        kernel list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] mm: don't clobber partially overlapping VMA with
 MAP_FIXED_NOREPLACE

On Wed 10-10-18 19:26:50, Jann Horn wrote:
[...]
> As you can see, the first page of the mapping at 0x10001000 was clobbered.
> 
> > > diff --git a/mm/mmap.c b/mm/mmap.c
> > > index 5f2b2b184c60..f7cd9cb966c0 100644
> > > --- a/mm/mmap.c
> > > +++ b/mm/mmap.c
> > > @@ -1410,7 +1410,7 @@ unsigned long do_mmap(struct file *file, unsigned long addr,
> > >       if (flags & MAP_FIXED_NOREPLACE) {
> > >               struct vm_area_struct *vma = find_vma(mm, addr);
> > >
> > > -             if (vma && vma->vm_start <= addr)
> > > +             if (vma && vma->vm_start < addr + len)
> >
> > find_vma is documented to - Look up the first VMA which satisfies addr <
> > vm_end, NULL if none.
> > This means that the above check guanratees that
> >         vm_start <= addr < vm_end
> > so an overlap is guanrateed. Why should we care how much we overlap?
> 
> "an overlap is guaranteed"? I have no idea what you're trying to say.

I have misread your changelog and the patch. Sorry about that. I thought
you meant a false possitive but you in fact meant false negative. Now it
makes complete sense.

Acked-by: Michal Hocko <mhocko@...e.com>

And thanks a lot for catching that!

-- 
Michal Hocko
SUSE Labs

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ