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] [day] [month] [year] [list]
Message-ID: <1b52ea23-0101-47cd-b49c-01a27316a54a@lucifer.local>
Date: Wed, 16 Apr 2025 15:42:35 +0100
From: Lorenzo Stoakes <lorenzo.stoakes@...cle.com>
To: Vlastimil Babka <vbabka@...e.cz>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
        Suren Baghdasaryan <surenb@...gle.com>,
        "Liam R . Howlett" <Liam.Howlett@...cle.com>,
        Matthew Wilcox <willy@...radead.org>,
        "Paul E . McKenney" <paulmck@...nel.org>,
        SeongJae Park <sj@...nel.org>, Shakeel Butt <shakeel.butt@...ux.dev>,
        David Hildenbrand <david@...hat.com>, linux-kernel@...r.kernel.org,
        linux-mm@...ck.org
Subject: Re: [PATCH v2 1/2] mm: move mmap/vma locking logic into specific
 files

On Wed, Apr 16, 2025 at 04:39:50PM +0200, Vlastimil Babka wrote:
> On 4/16/25 12:38, Lorenzo Stoakes wrote:
> > Currently the VMA and mmap locking logic is entangled in two of the most
> > overwrought files in mm - include/linux/mm.h and mm/memory.c. Separate this
> > logic out so we can more easily make changes and create an appropriate
> > MAINTAINERS entry that spans only the logic relating to locking.
> >
> > This should have no functional change. Care is taken to avoid dependency
> > loops, we must regrettably keep release_fault_lock() and
> > assert_fault_locked() in mm.h as a result due to the dependence on the
> > vm_fault type.
> >
> > Additionally we must declare rcuwait_wake_up() manually to avoid a
> > dependency cycle on linux/rcuwait.h.
> >
> > Additionally move the nommu implementatino of lock_mm_and_find_vma() to
> > mmap_lock.c so everything lock-related is in one place.
> >
> > Signed-off-by: Lorenzo Stoakes <lorenzo.stoakes@...cle.com>
> > Reviewed-by: Suren Baghdasaryan <surenb@...gle.com>
>
> Reviewed-by: Vlastimil Babka <vbabka@...e.cz>

Thanks!

>
> > diff --git a/mm/mmap_lock.c b/mm/mmap_lock.c
> > index e7dbaf96aa17..5f725cc67334 100644
> > --- a/mm/mmap_lock.c
> > +++ b/mm/mmap_lock.c
> > @@ -42,3 +42,276 @@ void __mmap_lock_do_trace_released(struct mm_struct *mm, bool write)
> >  }
> >  EXPORT_SYMBOL(__mmap_lock_do_trace_released);
> >  #endif /* CONFIG_TRACING */
> > +
> > +#ifdef CONFIG_MMU
> > +#ifdef CONFIG_PER_VMA_LOCK
>
> CONFIG_MMU is implied by CONFIG_PER_VMA_LOCK so you could move the first
> #ifdef later to make only #ifdef CONFIG_LOCK_MM_AND_FIND_VMA nested in it.
> But doesn't matter that much.
>

Yeah, as I said to Suren, I really like to be super-explicit about this,
nommu is such a painful and horrible thing that I like to really clearly
mark when we are doing a workaround for it rather than have it implicit.

Obviously I take the point, and we often do things implicitly, but I feel
overall it's better to spell it out super clearly here!

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ