Fix 32-bit boot failure due inaccurate page_pool_page_is_pp()
Subsystems (2)
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.
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 ;
Quoted 32 lines · Helge Deller
Commit
ee62ce7a1d90("page_pool: Track DMA-mapped pages and unmap them when destroying the pool") changedPP_MAGIC_MASKfrom0xFFFFFFFCto0xc000007con 32-bit platforms.The function
page_pool_page_is_pp()usesPP_MAGIC_MASKto 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 onPP_MAGIC_MASKand 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+Signed-off-by Helge Deller <[email protected]>Fixes ee62ce7a1d90 ("page_pool: Track DMA-mapped pages and unmap them when destroying the pool")include/linux/mm.h +0
-0
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
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") changedPP_MAGIC_MASKfrom0xFFFFFFFCto0xc000007con 32-bit platforms.The function
page_pool_page_is_pp()usesPP_MAGIC_MASKto 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 onPP_MAGIC_MASKand 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+Signed-off-by Helge Deller <[email protected]>Fixes ee62ce7a1d90 ("page_pool: Track DMA-mapped pages and unmap them when destroying the pool")include/linux/mm.h +0
-0@@ -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.
--
CheersDavid / dhildenb
Andrew Morton
maintainerQuoted 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 inaccuratepage_pool_page_is_pp()
Date: Fri, 12 Sep 2025 17:04:06 +0200Commit
ee62ce7a1d90("page_pool: Track DMA-mapped pages and unmap them when destroying the pool") changedPP_MAGIC_MASKfrom0xFFFFFFFCto0xc000007con 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
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 inaccuratepage_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") changedPP_MAGIC_MASKfrom0xFFFFFFFCto0xc000007con 32-bit platforms.
page_poolis a networking thing which partly lives inmm/.Can you please resend, Cc'ing the people and lists identified by
scripts/get_maintainer.plnet/core/page_pool.c
Sure, will resend accordingly.
Helge