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]
Message-ID: <CAHS8izN+-GVOp5cowjkT9WBXYf9Xg6BThWin8tWoKg2ZGFia0Q@mail.gmail.com>
Date:   Wed, 26 May 2021 16:19:43 -0700
From:   Mina Almasry <almasrymina@...gle.com>
To:     Mike Kravetz <mike.kravetz@...cle.com>
Cc:     Muchun Song <songmuchun@...edance.com>,
        Linux-MM <linux-mm@...ck.org>,
        open list <linux-kernel@...r.kernel.org>,
        Axel Rasmussen <axelrasmussen@...gle.com>,
        Peter Xu <peterx@...hat.com>,
        Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [External] [PATCH 0/2] Track reserve map changes to restore on error

On Wed, May 26, 2021 at 10:17 AM Mike Kravetz <mike.kravetz@...cle.com> wrote:
>
> On 5/25/21 8:19 PM, Muchun Song wrote:
> > On Wed, May 26, 2021 at 7:31 AM Mike Kravetz <mike.kravetz@...cle.com> wrote:
> >>
> >> Here is a modification to the reservation tracking for fixup on errors.
> >> It is a more general change, but should work for the hugetlb_mcopy_pte_atomic
> >> case as well.
> >>
> >> Perhaps use this as a prerequisite for your fix(es)?  Pretty sure this
> >> will eliminate the need for the call to hugetlb_unreserve_pages.
> >
> > Hi Mike,
> >
> > It seems like someone is fixing a bug, right? Maybe a link should be
> > placed in the cover letter so that someone can know what issue
> > we are facing.
> >
>
> Thanks Muchun,
>
> I wanted to first see if these patches would work in the code Mina is
> modifying.  If this works for Mina, then a more formal patch and request
> for inclusion will be sent.
>

So a quick test: I apply my patche and yours on top of linus/master,
and I remove the hugetlb_unreserve_pages() call that triggered this
conversation, and run the userfaultfd test, resv_huge_pages underflows
again, so it seems on the surface this doesn't quite work as is.

Not quite sure what to do off the top of my head. I think I will try
to debug why the 3 patches don't work together and I will fix either
your patch or mine. I haven't taken a deep look yet; I just ran a
quick test.

> I believe this issue has existed since the introduction of hugetlb
> reservations in v2.6.18.  Since the bug only shows up when we take error
> paths, the issue may not have been observed.  Mina found a similar issue
> in an error path which could also expose this issue.
> --
> Mike Kravetz

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ