All of lore.kernel.org
 help / color / mirror / Atom feed
* [to-be-updated] liveupdate-fix-boot-failure-due-to-kmemleak-access-to-unmapped-pages.patch removed from -mm tree
@ 2025-11-22 21:40 Andrew Morton
  0 siblings, 0 replies; only message in thread
From: Andrew Morton @ 2025-11-22 21:40 UTC (permalink / raw)
  To: mm-commits, rppt, pratyush, pasha.tatashin, graf, changyuanl,
	catalin.marinas, ran.xiaokai, akpm


The quilt patch titled
     Subject: liveupdate: fix boot failure due to kmemleak access to unmapped pages
has been removed from the -mm tree.  Its filename was
     liveupdate-fix-boot-failure-due-to-kmemleak-access-to-unmapped-pages.patch

This patch was dropped because an updated version will be issued

------------------------------------------------------
From: Ran Xiaokai <ran.xiaokai@zte.com.cn>
Subject: liveupdate: fix boot failure due to kmemleak access to unmapped pages
Date: Thu, 20 Nov 2025 14:41:47 +0000

When booting with debug_pagealloc=on while having:
CONFIG_KEXEC_HANDOVER_ENABLE_DEFAULT=y
CONFIG_DEBUG_KMEMLEAK_DEFAULT_OFF=n
the system fails to boot due to page faults during kmemleak scanning.

This occurs because:
With debug_pagealloc enabled, __free_pages() invokes
debug_pagealloc_unmap_pages(), clearing the _PAGE_PRESENT bit for freed
pages in the direct mapping.  Commit 3dc92c311498 ("kexec: add Kexec
HandOver (KHO) generation helpers") releases the KHO scratch region via
init_cma_reserved_pageblock(), unmapping its physical pages.  Subsequent
kmemleak scanning accesses these unmapped pages, triggering fatal page
faults.

Call kmemleak_no_scan_phys() from kho_reserve_scratch() to exclude the
reserved region from scanning before it is released to the buddy
allocator.

Link: https://lkml.kernel.org/r/20251120144147.90508-3-ranxiaokai627@163.com
Fixes: 3dc92c311498 ("kexec: add Kexec HandOver (KHO) generation helpers")
Signed-off-by: Ran Xiaokai <ran.xiaokai@zte.com.cn>
Cc: Alexander Graf <graf@amazon.com>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Changyuan Lyu <changyuanl@google.com>
Cc: Mike Rapoport <rppt@kernel.org>
Cc: Pasha Tatashin <pasha.tatashin@soleen.com>
Cc: Pratyush Yadav <pratyush@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 kernel/liveupdate/kexec_handover.c |    4 ++++
 1 file changed, 4 insertions(+)

--- a/kernel/liveupdate/kexec_handover.c~liveupdate-fix-boot-failure-due-to-kmemleak-access-to-unmapped-pages
+++ a/kernel/liveupdate/kexec_handover.c
@@ -11,6 +11,7 @@
 
 #include <linux/cleanup.h>
 #include <linux/cma.h>
+#include <linux/kmemleak.h>
 #include <linux/count_zeros.h>
 #include <linux/kexec.h>
 #include <linux/kexec_handover.h>
@@ -654,6 +655,7 @@ static void __init kho_reserve_scratch(v
 	if (!addr)
 		goto err_free_scratch_desc;
 
+	kmemleak_no_scan_phys(addr);
 	kho_scratch[i].addr = addr;
 	kho_scratch[i].size = size;
 	i++;
@@ -664,6 +666,7 @@ static void __init kho_reserve_scratch(v
 	if (!addr)
 		goto err_free_scratch_areas;
 
+	kmemleak_no_scan_phys(addr);
 	kho_scratch[i].addr = addr;
 	kho_scratch[i].size = size;
 	i++;
@@ -676,6 +679,7 @@ static void __init kho_reserve_scratch(v
 		if (!addr)
 			goto err_free_scratch_areas;
 
+		kmemleak_no_scan_phys(addr);
 		kho_scratch[i].addr = addr;
 		kho_scratch[i].size = size;
 		i++;
_

Patches currently in -mm which might be from ran.xiaokai@zte.com.cn are



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2025-11-22 21:40 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-22 21:40 [to-be-updated] liveupdate-fix-boot-failure-due-to-kmemleak-access-to-unmapped-pages.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.