Re: [PATCH v2 35/35] mm/hugetlb: resolve protnone faults without a uffd bit

From: Jose A. Perez de Azpillaga

Date: Sat Dec 05 2026 - 07:15:40 EST


On 12/3/26 12:37 PM, David Hildenbrand (Arm) wrote:
> From: Chris Mason <mason@xxxxxxxxxx>
>
> hugetlb_fault() only restores the protection of protnone entries that
> have the uffd bit set, assuming that accessible VMAs cannot have other
> protnone entries. If such an entry existed nevertheless, any access to
> it would result in an endless fault loop.
>
> We are not aware of a way to trigger this: paths that drop the uffd bit
> (fork(), mremap(), unregistering) restore the protection, and
> remove_migration_pte() only drops the uffd bit for writable migration
> entries, which cannot be created from protnone entries.
>
> Let's be defensive and make any protnone entry in an accessible VMA
> accessible again, unless it is an RWP fault that has to be reported to
> user space, like do_numa_page() does for small folios.
>
> Signed-off-by: Chris Mason <mason@xxxxxxxxxx>
> [ david: adjust comments and description ]
> Signed-off-by: David Hildenbrand (Arm) <david@xxxxxxxxxx>

LGTM:

Reviewed-by: Jose A. Perez de Azpillaga <azpijr@xxxxxxxxx>

--
cheers,
jose a. p-a