[PATCH v3 2/6] mm/rmap: use huge_ptep_get() in try_to_unmap_one()

Muchun Song muchun.song at linux.dev
Fri Jul 3 19:44:39 PDT 2026



> On Jul 3, 2026, at 19:41, Dev Jain <dev.jain at arm.com> wrote:
> 
> try_to_unmap_one() handles hugetlb folios when memory failure needs
> to replace a poisoned hugetlb mapping with a hwpoison entry. In that
> case page_vma_mapped_walk() returns the pte pointer to the hugetlb folio
> in pvmw.pte, but the code reads it 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.
> 
> Just use huge_ptep_get() for dereferencing a huge pte pointer.
> 
> Fixes: c7ab0d2fdc84 ("mm: convert try_to_unmap_one() to use page_vma_mapped_walk()")
> Cc: stable at vger.kernel.org
> Reported-by: David Hildenbrand <david at kernel.org>
> Signed-off-by: Dev Jain <dev.jain at arm.com>

Reviewed-by: Muchun Song <muchun.song at linux.dev>

Thanks.




More information about the linux-arm-kernel mailing list