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: <24224366-293a-879-95db-f69abcb0cb70@google.com>
Date:   Wed, 22 Sep 2021 16:18:09 -0700 (PDT)
From:   Hugh Dickins <hughd@...gle.com>
To:     Peter Xu <peterx@...hat.com>
cc:     Axel Rasmussen <axelrasmussen@...gle.com>,
        LKML <linux-kernel@...r.kernel.org>,
        Linux MM <linux-mm@...ck.org>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Andrea Arcangeli <aarcange@...hat.com>,
        Hugh Dickins <hughd@...gle.com>,
        Nadav Amit <nadav.amit@...il.com>
Subject: Re: [PATCH] mm/khugepaged: Detecting uffd-wp vma more efficiently

On Wed, 22 Sep 2021, Peter Xu wrote:
> 
> Not installing pmd means uffd-minor can still trap any further faults just like
> before, afaiu.
> 
> There's a very trivial detail that the pmd missing case will have a very slight
> code path change when the next page fault happens: in __handle_mm_fault() we'll
> first try to go into create_huge_pmd() once, however since shmem didn't provide
> huge_fault(), we'll go the VM_FAULT_FALLBACK path, and things will go like
> before when faulting on a small pte.  The next UFFDIO_CONTINUE will allocate
> that missing pmd again, however it'll install a 4K page only.

I think you're mistaken there.

I can't tell you much about ->huge_fault(), something introduced for
DAX I believe; but shmem has managed pmd mappings without it, since
before ->huge_fault() was ever added.

Look for the call to do_set_pmd() in finish_fault(): I think you'll
find that is the way shmem's huge pmds get in.

Earlier in the thread you suggested "shmem_getpage() only returns
small pages": but it can very well return PageTransCompound pages,
head or tail, which arrive at this do_set_pmd().

Hugh

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ