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: <Yl8bYKOJGW2py7Q0@xz-m1.local>
Date:   Tue, 19 Apr 2022 16:28:16 -0400
From:   Peter Xu <peterx@...hat.com>
To:     Johannes Weiner <hannes@...xchg.org>
Cc:     linux-kernel@...r.kernel.org, linux-mm@...ck.org,
        Mike Kravetz <mike.kravetz@...cle.com>,
        Nadav Amit <nadav.amit@...il.com>,
        Matthew Wilcox <willy@...radead.org>,
        Mike Rapoport <rppt@...ux.vnet.ibm.com>,
        David Hildenbrand <david@...hat.com>,
        Hugh Dickins <hughd@...gle.com>,
        Jerome Glisse <jglisse@...hat.com>,
        "Kirill A . Shutemov" <kirill@...temov.name>,
        Andrea Arcangeli <aarcange@...hat.com>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Axel Rasmussen <axelrasmussen@...gle.com>,
        Alistair Popple <apopple@...dia.com>
Subject: Re: [PATCH v8 22/23] mm: Enable PTE markers by default

On Tue, Apr 19, 2022 at 04:14:11PM -0400, Johannes Weiner wrote:
> Hi Peter,
> 
> On Tue, Apr 19, 2022 at 03:59:21PM -0400, Peter Xu wrote:
> > @@ -910,16 +910,16 @@ config ANON_VMA_NAME
> >  	  difference in their name.
> >  
> >  config PTE_MARKER
> > -	bool "Marker PTEs support"
> > -	default y
> > +	bool
> >  
> >  	help
> >  	  Allows to create marker PTEs for file-backed memory.
> >
> >  config PTE_MARKER_UFFD_WP
> > -	bool "Marker PTEs support for userfaultfd write protection"
> > +	bool "Userfaultfd write protection support for shmem/hugetlbfs"
> >  	default y
> > -	depends on PTE_MARKER && HAVE_ARCH_USERFAULTFD_WP
> > +	depends on HAVE_ARCH_USERFAULTFD_WP
> > +	select PTE_MARKER
> 
> This is much easier to understand, thanks!

Cool!  Sent as a formal patch just now.

> 
> Btw, this doesn't do much without userfaultfd being enabled in
> general, right?

So far yes, but I'm thinking there can be potential other users of
PTE_MARKERS from mm world.  The most close discussion is on the swap read
failures and this patch proposed by Miaohe:

https://lore.kernel.org/lkml/20220416030549.60559-1-linmiaohe@huawei.com/

So I hope we can still keep them around here under mm/ if possible, and
from the gut feeling it really should..

> Would it make sense to have it next to 'config USERFAULTFD' as a
> sub-option?

Yes another good question. :)

IIUC CONFIG_USERFAULTFD resides in init/Kconfig because it introduces a new
syscall.  Same to the rest of the bits for uffd since then, namely:

  - USERFAULTFD_WP
  - USERFAULTFD_MINOR

What I am thinking now is the other way round of your suggestion: whether
we should move most of them out, at least the _WP and _MINOR configs into
mm/?  Because IMHO they are really pure mm ideas and they're irrelevant to
syscalls and init.

Any thoughts?

-- 
Peter Xu

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ