[PATCH 29/46] mm/mremap: use pudp_huge_get_and_clear() when moving huge PUDs

Pedro Falcato pfalcato at suse.de
Wed Oct 28 06:28:04 PDT 2026


On Tue, Oct 27, 2026 at 12:17:49AM +0100, David Hildenbrand (Arm) wrote:
> move_huge_pud() reads the old PUD and clears it in separate operations.
> Hardware accessed or dirty updates between those operations can be lost
> when the saved entry is installed at the new address.
> 
> The raw pud_clear() also bypasses page_table_check_pud_clear(), while
> set_pud_at() accounts for the destination mapping. This leaves the
> checker counts unbalanced for mappings tracked by page table checking.
> 
> To fix it, simply use pudp_huge_get_and_clear().
> 
> Fixes: 7d846db7d0e2 ("mm/mremap: convert huge PUD move to separate helper")
> Cc: stable at vger.kernel.org
> Reviewed-by: Lorenzo Stoakes (ARM) <ljs at kernel.org>
> Signed-off-by: David Hildenbrand (Arm) <david at kernel.org>

Reviewed-by: Pedro Falcato <pfalcato at suse.de>

At what point do we ban straight up clearing a PTE/PMD/PUD/etc? :)

-- 
Pedro



More information about the kexec mailing list