]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
powerpc/crash: adjust the elfcorehdr size
authorSourabh Jain <sourabhjain@linux.ibm.com>
Fri, 27 Feb 2026 17:18:01 +0000 (22:48 +0530)
committerMadhavan Srinivasan <maddy@linux.ibm.com>
Wed, 4 Mar 2026 05:42:48 +0000 (11:12 +0530)
commit04e707cb77c272cb0bb2e2e3c5c7f844d804a089
tree6a23d04d98d0cfdb7b0885cd0e1c8dadf97e94e3
parent20197b967a6a29dab81495f25a988515bda84cfe
powerpc/crash: adjust the elfcorehdr size

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

Update elf_headers_sz (the kimage member representing the size of the
elfcorehdr kexec segment) to reflect the total memory allocated for the
elfcorehdr segment instead of the elfcorehdr buffer size at the time of
kdump load. This allows of_kexec_alloc_and_setup_fdt() to reserve the
full elfcorehdr memory in the kdump FDT and prevents elfcorehdr
corruption.

Fixes: 849599b702ef8 ("powerpc/crash: add crash memory hotplug support")
Reviewed-by: Hari Bathini <hbathini@linux.ibm.com>
Signed-off-by: Sourabh Jain <sourabhjain@linux.ibm.com>
Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com>
Link: https://patch.msgid.link/20260227171801.2238847-1-sourabhjain@linux.ibm.com
arch/powerpc/kexec/file_load_64.c