In the Linux kernel, the following vulnerability has been resolved: mm: khugepaged: fix folio is used after pte_unmap_unlock() After the page table lock has dropped, the folio can be freed concurrently. The trace_mm_khugepaged_scan_pmd() is left with a dangling folio pointer. So using the folio_pfn() before dropping the page table lock, closing use-after-free window. And other pre-existing bug, When the `for (i = 0; i < HPAGE_PMD_NR; i++)` iteration to terminate and the folio operation preceding is normal, but pfn will be incorrect. so we really only trace the PFN if it really was problematic.
https://git.kernel.org/stable/c/ba2f1f92ddfabd340c9248fd2380104f717ee8b1
https://git.kernel.org/stable/c/931c01918ebb75b589db1c68e07713eac2e0aabd
https://git.kernel.org/stable/c/6bfd20c1f7ef92417ff4efd878ca52f9ac51f9d0
https://git.kernel.org/stable/c/6534f1867a63c8a40a27d96b50c9f0b4ffaf6d5f