Re: [PATCH v3 3/6] mm/rmap: use huge_ptep_get() in try_to_migrate_one()
From: "David Hildenbrand (Arm)" <david@kernel.org>
Date: 2026-07-06 08:46:56
Also in:
linux-mm, lkml, stable
From: "David Hildenbrand (Arm)" <david@kernel.org>
Date: 2026-07-06 08:46:56
Also in:
linux-mm, lkml, stable
On 7/3/26 13:41, Dev Jain wrote:
try_to_migrate_one() is used by folio migration to replace a present
mapping with a migration entry. For hugetlb folios, page_vma_mapped_walk()
returns the pte pointer to the hugetlb folio in pvmw.pte, but the code
reads the huge pte entry with ptep_get().
On arches which provide their own huge_ptep_get() to dereference a huge
pte pointer, accessing via ptep_get() would cause pte_pfn(), pte_present()
etc to misbehave.
It is not clear whether this has a trivially visible effect to userspace.
Use huge_ptep_get() to dereference a huge pte pointer.
Commit a98a2f0c8ce1 copied the bug from try_to_unmap_one into
try_to_migrate_one.
Fixes: a98a2f0c8ce1 ("mm/rmap: split migration into its own function")
Cc: stable@vger.kernel.org
Acked-by: Muchun Song <muchun.song@linux.dev>
Signed-off-by: Dev Jain <dev.jain@arm.com>
---Acked-by: David Hildenbrand (Arm) <david@kernel.org> -- Cheers, David