Skip to contentSkip to conversation

Fix 32-bit boot failure due inaccurate page_pool_page_is_pp()

PATCH In review Helge Deller 5 participants 5 messages Sep 12, 2025 – Sep 17, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix 32-bit boot failure due inaccurate page_pool_page_is_pp()

Commit ee62ce7a1d90 ("page_pool: Track DMA-mapped pages and unmap them when destroying the pool") changed PP_MAGIC_MASK from 0xFFFFFFFC to 0xc000007c on 32-bit platforms.

The function page_pool_page_is_pp() uses PP_MAGIC_MASK to identify page pool pages, but the remaining bits are not sufficient to unambiguously identify such pages any longer.

So page_pool_page_is_pp() now sometimes wrongly reports pages as page pool pages and as such triggers a kernel BUG as it believes it found a page pool leak.

There are patches upcoming where page_pool_page_is_pp() will not depend on PP_MAGIC_MASK and instead use page flags to identify page pool pages. Until those patches are merged, the easiest temporary fix is to disable the check on 32-bit platforms.

Cc David Hildenbrand <[email protected]>
Cc Toke Høiland-Jørgensen <[email protected]>
Cc Linux Memory Management List <[email protected]>
Cc Linux parisc List <[email protected]>
Cc <[email protected]> # v6.15+
Fixes ee62ce7a1d90 ("page_pool: Track DMA-mapped pages and unmap them when destroying the pool")
include/linux/mm.h +1 -1
index 1ae97a0b8ec7..f3822ae70a81 100644
@@ -4190,7 +4190,7 @@ int arch_lock_shadow_stack_status(struct task_struct *t, unsigned long status);
  */
 #define PP_MAGIC_MASK ~(PP_DMA_INDEX_MASK | 0x3UL)
 
-#ifdef CONFIG_PAGE_POOL
+#if defined(CONFIG_PAGE_POOL) && defined(CONFIG_64BIT)
 static inline bool page_pool_page_is_pp(const struct page *page)
 {
 	treturn (page->pp_magic & PP_MAGIC_MASK) == PP_SIGNATURE;
Acked-by on v1 1/1
#1 lore raw
Quoted 32 lines · Helge Deller

Commit ee62ce7a1d90 ("page_pool: Track DMA-mapped pages and unmap them when destroying the pool") changed PP_MAGIC_MASK from 0xFFFFFFFC to 0xc000007c on 32-bit platforms.

The function page_pool_page_is_pp() uses PP_MAGIC_MASK to identify page pool pages, but the remaining bits are not sufficient to unambiguously identify such pages any longer.

So page_pool_page_is_pp() now sometimes wrongly reports pages as page pool pages and as such triggers a kernel BUG as it believes it found a page pool leak.

There are patches upcoming where page_pool_page_is_pp() will not depend on PP_MAGIC_MASK and instead use page flags to identify page pool pages. Until those patches are merged, the easiest temporary fix is to disable the check on 32-bit platforms.

Cc David Hildenbrand <[email protected]>
Cc Toke Høiland-Jørgensen <[email protected]>
Cc Linux Memory Management List <[email protected]>
Cc Linux parisc List <[email protected]>
Cc <[email protected]> # v6.15+
Fixes ee62ce7a1d90 ("page_pool: Track DMA-mapped pages and unmap them when destroying the pool")
include/linux/mm.h +0 -0
index 1ae97a0b8ec7..f3822ae70a81 100644

include/linux/mm.h int arch_lock_shadow_stack_status(struct task_struct *t, unsigned long status); · line 4196

Quoted 8 lines
include/linux/mm.h +1 -1
@@ -4190,7 +4190,7 @@ int arch_lock_shadow_stack_status(struct task_struct *t, unsigned long status);
   */
  #define PP_MAGIC_MASK ~(PP_DMA_INDEX_MASK | 0x3UL)
 
-#ifdef CONFIG_PAGE_POOL
+#if defined(CONFIG_PAGE_POOL) && defined(CONFIG_64BIT)
  static inline bool page_pool_page_is_pp(const struct page *page)
  {
  	treturn (page->pp_magic & PP_MAGIC_MASK) == PP_SIGNATURE;

As a temporary fix this LGTM.

But I want to hear other opinions.

Signature · 3 lines
Cheers

David / dhildenb
#2 lore raw
Quoted 35 lines · David Hildenbrand
Quoted 34 lines · Helge Deller

Commit ee62ce7a1d90 ("page_pool: Track DMA-mapped pages and unmap them when destroying the pool") changed PP_MAGIC_MASK from 0xFFFFFFFC to 0xc000007c on 32-bit platforms.

The function page_pool_page_is_pp() uses PP_MAGIC_MASK to identify page pool pages, but the remaining bits are not sufficient to unambiguously identify such pages any longer.

So page_pool_page_is_pp() now sometimes wrongly reports pages as page pool pages and as such triggers a kernel BUG as it believes it found a page pool leak.

There are patches upcoming where page_pool_page_is_pp() will not depend on PP_MAGIC_MASK and instead use page flags to identify page pool pages. Until those patches are merged, the easiest temporary fix is to disable the check on 32-bit platforms.

Cc David Hildenbrand <[email protected]>
Cc Toke Høiland-Jørgensen <[email protected]>
Cc Linux Memory Management List <[email protected]>
Cc Linux parisc List <[email protected]>
Cc <[email protected]> # v6.15+
Fixes ee62ce7a1d90 ("page_pool: Track DMA-mapped pages and unmap them when destroying the pool")
include/linux/mm.h +0 -0
index 1ae97a0b8ec7..f3822ae70a81 100644
@@ -4190,7 +4190,7 @@ int arch_lock_shadow_stack_status(struct task_struct *t, unsigned long status);
   */
  #define PP_MAGIC_MASK ~(PP_DMA_INDEX_MASK | 0x3UL)
 
Quoted 8 lines

include/linux/mm.h int arch_lock_shadow_stack_status(struct task_struct *t, unsigned long status); · line 4196

Quoted 6 lines
include/linux/mm.h +1 -1
-#ifdef CONFIG_PAGE_POOL
+#if defined(CONFIG_PAGE_POOL) && defined(CONFIG_64BIT)
  static inline bool page_pool_page_is_pp(const struct page *page)
  {
      treturn (page->pp_magic & PP_MAGIC_MASK) == PP_SIGNATURE;

As a temporary fix this LGTM.

Sure. As a temporary fix, why not.

I need to start the work replacing page_pool_page_is_pp() with using page type again tho.

Byungchul

Quoted 9 lines

But I want to hear other opinions.

--
Cheers

David / dhildenb

maintainer
#3 lore raw
In reply to Helge Deller
Quoted 7 lines · On Fri, 12 Sep 2025 17:04:06 +0200 Helge Deller <[email protected]> wrote:

To: David Hildenbrand <[email protected]>, Toke Høiland-Jørgensen <[email protected]>, Linux Memory Management List <[email protected]>, Linux parisc List <[email protected]>, Andrew Morton <[email protected]>
Subject: [PATCH] Fix 32-bit boot failure due inaccurate page_pool_page_is_pp()
Date: Fri, 12 Sep 2025 17:04:06 +0200

Commit ee62ce7a1d90 ("page_pool: Track DMA-mapped pages and unmap them when destroying the pool") changed PP_MAGIC_MASK from 0xFFFFFFFC to 0xc000007c on 32-bit platforms.

page_pool is a networking thing which partly lives in mm/.

Can you please resend, Cc'ing the people and lists identified by
scripts/get_maintainer.pl net/core/page_pool.c

#4 lore raw
Quoted 6 lines · Andrew Morton
Quoted 4 lines · On Fri, 12 Sep 2025 17:04:06 +0200 Helge Deller <[email protected]> wrote:

To: David Hildenbrand <[email protected]>, Toke Høiland-Jørgensen <[email protected]>, Linux Memory Management List <[email protected]>, Linux parisc List <[email protected]>, Andrew Morton <[email protected]>
Subject: [PATCH] Fix 32-bit boot failure due inaccurate page_pool_page_is_pp()
Date: Fri, 12 Sep 2025 17:04:06 +0200

Quoted 8 lines
Quoted 3 lines

Commit ee62ce7a1d90 ("page_pool: Track DMA-mapped pages and unmap them when destroying the pool") changed PP_MAGIC_MASK from 0xFFFFFFFC to 0xc000007c on 32-bit platforms.

page_pool is a networking thing which partly lives in mm/.

Can you please resend, Cc'ing the people and lists identified by
scripts/get_maintainer.pl net/core/page_pool.c

Sure, will resend accordingly.

Helge