summaryrefslogtreecommitdiff
path: root/fs/proc
diff options
context:
space:
mode:
authorDavid Hildenbrand <david@redhat.com>2025-06-17 16:35:32 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-07-06 11:01:39 +0200
commit93abf5e0d584bb53b43db54e37434647040cf5f1 (patch)
tree260711460908a7fc1ade416277b63785ac3e783e /fs/proc
parentf855b119e62b004a5044ed565f2a2b368c4d3f16 (diff)
downloadlinux-93abf5e0d584bb53b43db54e37434647040cf5f1.tar.gz
linux-93abf5e0d584bb53b43db54e37434647040cf5f1.tar.bz2
linux-93abf5e0d584bb53b43db54e37434647040cf5f1.zip
fs/proc/task_mmu: fix PAGE_IS_PFNZERO detection for the huge zero folio
commit 4a5e85f4eb8fd18b1266342d100e4f0849544ca0 upstream. is_zero_pfn() does not work for the huge zero folio. Fix it by using is_huge_zero_pmd(). This can cause the PAGEMAP_SCAN ioctl against /proc/pid/pagemap to present pages as PAGE_IS_PRESENT rather than as PAGE_IS_PFNZERO. Found by code inspection. Link: https://lkml.kernel.org/r/20250617143532.2375383-1-david@redhat.com Fixes: 52526ca7fdb9 ("fs/proc/task_mmu: implement IOCTL to get and optionally clear info about PTEs") Signed-off-by: David Hildenbrand <david@redhat.com> Cc: Muhammad Usama Anjum <usama.anjum@collabora.com> Cc: <stable@vger.kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs/proc')
-rw-r--r--fs/proc/task_mmu.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c
index 536b7dc45381..96fe904b2ac5 100644
--- a/fs/proc/task_mmu.c
+++ b/fs/proc/task_mmu.c
@@ -2155,7 +2155,7 @@ static unsigned long pagemap_thp_category(struct pagemap_scan_private *p,
categories |= PAGE_IS_FILE;
}
- if (is_zero_pfn(pmd_pfn(pmd)))
+ if (is_huge_zero_pmd(pmd))
categories |= PAGE_IS_PFNZERO;
if (pmd_soft_dirty(pmd))
categories |= PAGE_IS_SOFT_DIRTY;