* [merged mm-stable] mm-page_alloc-make-sure-tail_page-private-is-zero-at-page-free-time.patch removed from -mm tree
@ 2026-08-05 2:23 Andrew Morton
0 siblings, 0 replies; only message in thread
From: Andrew Morton @ 2026-08-05 2:23 UTC (permalink / raw)
To: mm-commits, vbabka, tj, surenb, ryan.roberts, rppt, npache,
mhocko, ljs, liam, lance.yang, jackmanb, hannes, dev.jain, dennis,
david, brendan.jackman, baolin.wang, baohua, apopple, ziy, akpm
The quilt patch titled
Subject: mm/page_alloc: make sure tail_page->private is zero at page free time
has been removed from the -mm tree. Its filename was
mm-page_alloc-make-sure-tail_page-private-is-zero-at-page-free-time.patch
This patch was dropped because it was merged into the mm-stable branch
of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
------------------------------------------------------
From: Zi Yan <ziy@nvidia.com>
Subject: mm/page_alloc: make sure tail_page->private is zero at page free time
Date: Thu, 09 Jul 2026 14:06:04 -0400
Any code using tail_page->private of a folio, a compound page or a
high-order page is supposed to reset it after use, otherwise ->private
data can leak to new page user and cause unexpected issues. Add a
bad_page() check at page free path for it.
Link: https://lore.kernel.org/20260709-keep-subpage-private-zero-at-free-v3-4-7e4fe155f5b9@nvidia.com
Signed-off-by: Zi Yan <ziy@nvidia.com>
Reviewed-by: Vlastimil Babka (SUSE) <vbabka@kernel.org>
Acked-by: David Hildenbrand (Arm) <david@kernel.org>
Cc: Alistair Popple <apopple@nvidia.com>
Cc: Baolin Wang <baolin.wang@linux.alibaba.com>
Cc: Barry Song <baohua@kernel.org>
Cc: Brendan Jackman <jackmanb@google.com>
Cc: Brendan Jackman <brendan.jackman@linux.dev>
Cc: Dennis Zhou <dennis@kernel.org>
Cc: Dev Jain <dev.jain@arm.com>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Cc: Lance Yang <lance.yang@linux.dev>
Cc: Liam R. Howlett <liam@infradead.org>
Cc: Lorenzo Stoakes <ljs@kernel.org>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Mike Rapoport <rppt@kernel.org>
Cc: Nico Pache <npache@redhat.com>
Cc: Ryan Roberts <ryan.roberts@arm.com>
Cc: Suren Baghdasaryan <surenb@google.com>
Cc: Tejun Heo <tj@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
mm/page_alloc.c | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
--- a/mm/page_alloc.c~mm-page_alloc-make-sure-tail_page-private-is-zero-at-page-free-time
+++ a/mm/page_alloc.c
@@ -1377,15 +1377,23 @@ static __always_inline bool __free_pages
#endif
}
for (i = 1; i < (1 << order); i++) {
+ struct page *tail_page = page + i;
+
if (compound)
- bad += free_tail_page_prepare(page, page + i);
+ bad += free_tail_page_prepare(page, tail_page);
if (is_check_pages_enabled()) {
- if (free_page_is_bad(page + i)) {
+ if (free_page_is_bad(tail_page)) {
+ bad++;
+ continue;
+ }
+
+ if (tail_page->private) {
+ bad_page(tail_page, "nonzero private");
bad++;
continue;
}
}
- (page + i)->flags.f &= ~PAGE_FLAGS_CHECK_AT_PREP;
+ tail_page->flags.f &= ~PAGE_FLAGS_CHECK_AT_PREP;
}
}
if (folio_test_anon(folio)) {
_
Patches currently in -mm which might be from ziy@nvidia.com are
mm-huge_memory-use-folios-memcg-inside-__folio_split.patch
xarray-honor-xa_flags_account-in-xas_split_alloc.patch
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2026-08-05 2:23 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-05 2:23 [merged mm-stable] mm-page_alloc-make-sure-tail_page-private-is-zero-at-page-free-time.patch removed from -mm tree Andrew Morton
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.