Skip to contentSkip to conversation

mm-util-dont-read-__page_2-for-order-1-folios-in-snapshot_page.patch removed from -mm tree

merged mm-hotfixes-stable Andrew Morton 1 participant 1 message Jul 21 Stable branch

lore
Share & tools
lore

Andrew Morton

author tree notice Applied
#0 lore raw

The quilt patch titled
Subject: mm/util: don't read __page_2 for order-1 folios in snapshot_page()
has been removed from the -mm tree. Its filename was
mm-util-dont-read-__page_2-for-order-1-folios-in-snapshot_page.patch

This patch was dropped because it was merged into the mm-hotfixes-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

------------------------------------------------------
From: Aboorva Devarajan <[email protected]>
Subject: mm/util: don't read __page_2 for order-1 folios in snapshot_page()
Date: Thu, 9 Jul 2026 01:49:54 +0530

snapshot_page() currently reads __page_2 after checking nr_pages > 1, but it should only do so when nr_pages > 2.

If an order-1 folio is allocated at the end of a vmemmap section, __page_2 will not exist and reading it will cause a fault.

During DLPAR memory remove on a 22 TB ppc64le LPAR, snapshot_page() oopsed on the page isolation path while reading an order-1 folio's __page_2 from an adjacent absent section (unmapped vmemmap).

Fix this to avoid reading memmap that doesn't exist (e.g., a vmemmap hole).

Fixes 31a31da8a618 ("mm: move _pincount in folio to page[2] on 32bit")
Cc Liam R. Howlett <[email protected]>
Cc Michal Hocko <[email protected]>
Cc Mike Rapoport <[email protected]>
Cc "Ritesh Harjani (IBM)" <[email protected]>
Cc Suren Baghdasaryan <[email protected]>
Cc Vlastimil Babka <[email protected]>
Cc <[email protected]> # v6.15+

---

 mm/util.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mm/util.c renamed from mm/util.c~mm-util-dont-read-__page_2-for-order-1-folios-in-snapshot_page +1 -1
@@ -1353,7 +1353,7 @@ again:
 	if (ps->idx < MAX_FOLIO_NR_PAGES) {
 		memcpy(&ps->folio_snapshot, foliop, 2 * sizeof(struct page));
 		nr_pages = folio_nr_pages(&ps->folio_snapshot);
-		if (nr_pages > 1)
+		if (nr_pages > 2)
 			memcpy(&ps->folio_snapshot.__page_2, &foliop->__page_2,
 			       sizeof(struct page));
 		set_ps_flags(ps, foliop, page);

_

Patches currently in -mm which might be from [email protected] are