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: <9b43a8ca-e6fb-49f2-9a95-b5088c6d3352@kernel.org>
Date: Wed, 14 Jan 2026 12:14:43 +0100
From: "David Hildenbrand (Red Hat)" <david@...nel.org>
To: Lorenzo Stoakes <lorenzo.stoakes@...cle.com>,
 Andrew Morton <akpm@...ux-foundation.org>
Cc: "Liam R . Howlett" <Liam.Howlett@...cle.com>,
 Vlastimil Babka <vbabka@...e.cz>, Mike Rapoport <rppt@...nel.org>,
 Suren Baghdasaryan <surenb@...gle.com>, Michal Hocko <mhocko@...e.com>,
 Pedro Falcato <pfalcato@...e.de>, linux-mm@...ck.org,
 linux-kernel@...r.kernel.org, Chris Mason <clm@...a.com>
Subject: Re: [PATCH mm-hotfixes] mm: do not copy page tables unnecessarily for
 VM_UFFD_WP

On 1/14/26 12:00, Lorenzo Stoakes wrote:
> Commit ab04b530e7e8 ("mm: introduce copy-on-fork VMAs and make
> VM_MAYBE_GUARD one") aggregates flags checks in vma_needs_copy(), including
> VM_UFFD_WP.
> 
> However in doing so, it incorrectly performed this check against
> src_vma. This check was done on the assumption that all relevant flags are
> copied upon fork.
> 
> However the userfaultfd logic is very innovative in that it implements
> custom logic on fork in dup_userfaultfd(), including a rather well hidden
> case where lacking UFFD_FEATURE_EVENT_FORK causes VM_UFFD_WP to not be
> propagated to the destination VMA.
> 
> And indeed, vma_needs_copy(), prior to this patch, did check this property
> on dst_vma, not src_vma.
> 
> Since all the other relevant flags are copied on fork, we can simply fix
> this by checking against dst_vma.
> 
> While we're here, we fix a comment against VM_COPY_ON_FORK (noting that it
> did indeed already reference dst_vma) to make it abundantly clear that we
> must check against the destination VMA.
> 
> Reported-by: Chris Mason <clm@...a.com>
> Closes: https://lore.kernel.org/all/20260113231257.3002271-1-clm@meta.com/
> Fixes: ab04b530e7e8 ("mm: introduce copy-on-fork VMAs and make VM_MAYBE_GUARD one")
> Signed-off-by: Lorenzo Stoakes <lorenzo.stoakes@...cle.com>

Acked-by: David Hildenbrand (Red Hat) <david@...nel.org>

-- 
Cheers

David

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ