[PATCH] ppc64: Reserve FDT memory for full elfcorehdr memory size

Sourabh Jain sourabhjain at linux.ibm.com
Mon Feb 9 21:05:36 PST 2026


With --hotplug support, extra memory is added to elfcorehdr kexec
segment to accommodate additional resources during memory hotplug
events. However, the FDT is not updated with the same size, which
can lead to elfcorehdr corruption in the kdump kernel.

Fix this by updating the elfcorehdr size in the FDT memory
reservation entry to use its actual memsz instead of the current
buffer size.

Fixes: b8408c95e7c0 ("powerpc/kexec_load: add hotplug support")
Cc: Shivang Upadhyay <shivangu at linux.ibm.com>
Cc: Simon Horman <horms at kernel.org>
Signed-off-by: Sourabh Jain <sourabhjain at linux.ibm.com>
---
 kexec/arch/ppc64/crashdump-ppc64.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kexec/arch/ppc64/crashdump-ppc64.c b/kexec/arch/ppc64/crashdump-ppc64.c
index 98d439a..2816a1b 100644
--- a/kexec/arch/ppc64/crashdump-ppc64.c
+++ b/kexec/arch/ppc64/crashdump-ppc64.c
@@ -543,7 +543,7 @@ int load_crashdump_segments(struct kexec_info *info, char* mod_cmdline,
 	/* Record the location of the elfcorehdr for hotplug handling */
 	info->elfcorehdr = elfcorehdr = add_buffer(info, tmp, sz, memsz, align,
 						   min_base, max_addr, 1);
-	reserve(elfcorehdr, sz);
+	reserve(elfcorehdr, memsz);
 	/* modify and store the cmdline in a global array. This is later
 	 * read by flatten_device_tree and modified if required
 	 */
-- 
2.52.0




More information about the kexec mailing list