Re: [PATCH v3 4/9] mm/migrate: warn on a writable migration entry with the uffd bit set
From: David Hildenbrand (Arm)
Date: Wed Nov 18 2026 - 04:40:02 EST
On 11/18/26 05:28, Tal Zussman wrote:
> A writable migration entry must not have the uffd bit set. Every path
> that sets the bit on a migration entry makes the entry read-only first.
> PAGEMAP_SCAN was the one path that did not, and it now does as well.
>
> remove_migration_pte() restores such an entry writable and drops the
> uffd bit, while remove_migration_pmd() sets the bit and write-protects
> the PMD.
>
> Warn in both paths on a writable entry with the uffd bit set. Also make
> the PMD path only set the uffd bit for a read-only entry, like the PTE
> path, so that the two behave the same, as this should never happen.
>
> Signed-off-by: Tal Zussman <tz2294@xxxxxxxxxxxx>
> ---
Acked-by: David Hildenbrand (Arm) <david@xxxxxxxxxx>
--
Cheers,
David