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

From: Muchun Song

Date: Fri Dec 04 2026 - 01:36:08 EST




> On Dec 3, 2026, at 19:37, David Hildenbrand (Arm) <david@xxxxxxxxxx> 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>

Acked-by: Muchun Song (ByteDance) <muchun.song@xxxxxxxxx>

THanks.