* [PATCH] Fix 32-bit boot failure due inaccurate page_pool_page_is_pp()
@ 2025-09-12 15:04 Helge Deller
2025-09-12 15:49 ` David Hildenbrand
2025-09-12 22:47 ` Andrew Morton
0 siblings, 2 replies; 5+ messages in thread
From: Helge Deller @ 2025-09-12 15:04 UTC (permalink / raw)
To: David Hildenbrand, Toke Høiland-Jørgensen,
Linux Memory Management List, Linux parisc List, Andrew Morton
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 <david@redhat.com>
Cc: Toke Høiland-Jørgensen <toke@redhat.com>
Cc: Linux Memory Management List <linux-mm@kvack.org>
Cc: Linux parisc List <linux-parisc@vger.kernel.org>
Cc: <stable@vger.kernel.org> # v6.15+
Signed-off-by: Helge Deller <deller@gmx.de>
Link: https://www.spinics.net/lists/kernel/msg5849623.html
Fixes: ee62ce7a1d90 ("page_pool: Track DMA-mapped pages and unmap them when destroying the pool")
diff --git a/include/linux/mm.h b/include/linux/mm.h
index 1ae97a0b8ec7..f3822ae70a81 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -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;
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] Fix 32-bit boot failure due inaccurate page_pool_page_is_pp()
2025-09-12 15:04 [PATCH] Fix 32-bit boot failure due inaccurate page_pool_page_is_pp() Helge Deller
@ 2025-09-12 15:49 ` David Hildenbrand
2025-09-17 4:26 ` Byungchul Park
2025-09-12 22:47 ` Andrew Morton
1 sibling, 1 reply; 5+ messages in thread
From: David Hildenbrand @ 2025-09-12 15:49 UTC (permalink / raw)
To: Helge Deller, Toke Høiland-Jørgensen,
Linux Memory Management List, Linux parisc List, Andrew Morton
Cc: Byungchul Park
On 12.09.25 17:04, Helge Deller wrote:
> 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 <david@redhat.com>
> Cc: Toke Høiland-Jørgensen <toke@redhat.com>
> Cc: Linux Memory Management List <linux-mm@kvack.org>
> Cc: Linux parisc List <linux-parisc@vger.kernel.org>
> Cc: <stable@vger.kernel.org> # v6.15+
> Signed-off-by: Helge Deller <deller@gmx.de>
> Link: https://www.spinics.net/lists/kernel/msg5849623.html
> Fixes: ee62ce7a1d90 ("page_pool: Track DMA-mapped pages and unmap them when destroying the pool")
>
> diff --git a/include/linux/mm.h b/include/linux/mm.h
> index 1ae97a0b8ec7..f3822ae70a81 100644
> --- a/include/linux/mm.h
> +++ b/include/linux/mm.h
> @@ -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.
Acked-by: David Hildenbrand <david@redhat.com>
--
Cheers
David / dhildenb
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] Fix 32-bit boot failure due inaccurate page_pool_page_is_pp()
2025-09-12 15:04 [PATCH] Fix 32-bit boot failure due inaccurate page_pool_page_is_pp() Helge Deller
2025-09-12 15:49 ` David Hildenbrand
@ 2025-09-12 22:47 ` Andrew Morton
2025-09-12 23:05 ` Helge Deller
1 sibling, 1 reply; 5+ messages in thread
From: Andrew Morton @ 2025-09-12 22:47 UTC (permalink / raw)
To: Helge Deller
Cc: David Hildenbrand, Toke Høiland-Jørgensen,
Linux Memory Management List, Linux parisc List
On Fri, 12 Sep 2025 17:04:06 +0200 Helge Deller <deller@kernel.org> wrote:
> To: David Hildenbrand <david@redhat.com>, Toke Høiland-Jørgensen <toke@redhat.com>, Linux Memory Management List <linux-mm@kvack.org>, Linux parisc List <linux-parisc@vger.kernel.org>, Andrew Morton <akpm@linux-foundation.org>
> 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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] Fix 32-bit boot failure due inaccurate page_pool_page_is_pp()
2025-09-12 22:47 ` Andrew Morton
@ 2025-09-12 23:05 ` Helge Deller
0 siblings, 0 replies; 5+ messages in thread
From: Helge Deller @ 2025-09-12 23:05 UTC (permalink / raw)
To: Andrew Morton, Helge Deller
Cc: David Hildenbrand, Toke Høiland-Jørgensen,
Linux Memory Management List, Linux parisc List
On 9/13/25 00:47, Andrew Morton wrote:
> On Fri, 12 Sep 2025 17:04:06 +0200 Helge Deller <deller@kernel.org> wrote:
>
>> To: David Hildenbrand <david@redhat.com>, Toke Høiland-Jørgensen <toke@redhat.com>, Linux Memory Management List <linux-mm@kvack.org>, Linux parisc List <linux-parisc@vger.kernel.org>, Andrew Morton <akpm@linux-foundation.org>
>> 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
Sure, will resend accordingly.
Helge
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] Fix 32-bit boot failure due inaccurate page_pool_page_is_pp()
2025-09-12 15:49 ` David Hildenbrand
@ 2025-09-17 4:26 ` Byungchul Park
0 siblings, 0 replies; 5+ messages in thread
From: Byungchul Park @ 2025-09-17 4:26 UTC (permalink / raw)
To: David Hildenbrand
Cc: Helge Deller, Toke Høiland-Jørgensen,
Linux Memory Management List, Linux parisc List, Andrew Morton,
kernel_team
On Fri, Sep 12, 2025 at 05:49:15PM +0200, David Hildenbrand wrote:
> On 12.09.25 17:04, Helge Deller wrote:
> > 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 <david@redhat.com>
> > Cc: Toke Høiland-Jørgensen <toke@redhat.com>
> > Cc: Linux Memory Management List <linux-mm@kvack.org>
> > Cc: Linux parisc List <linux-parisc@vger.kernel.org>
> > Cc: <stable@vger.kernel.org> # v6.15+
> > Signed-off-by: Helge Deller <deller@gmx.de>
> > Link: https://www.spinics.net/lists/kernel/msg5849623.html
> > Fixes: ee62ce7a1d90 ("page_pool: Track DMA-mapped pages and unmap them when destroying the pool")
> >
> > diff --git a/include/linux/mm.h b/include/linux/mm.h
> > index 1ae97a0b8ec7..f3822ae70a81 100644
> > --- a/include/linux/mm.h
> > +++ b/include/linux/mm.h
> > @@ -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.
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
> But I want to hear other opinions.
>
> Acked-by: David Hildenbrand <david@redhat.com>
>
> --
> Cheers
>
> David / dhildenb
>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2025-09-17 4:26 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-09-12 15:04 [PATCH] Fix 32-bit boot failure due inaccurate page_pool_page_is_pp() Helge Deller
2025-09-12 15:49 ` David Hildenbrand
2025-09-17 4:26 ` Byungchul Park
2025-09-12 22:47 ` Andrew Morton
2025-09-12 23:05 ` Helge Deller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox