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 <[email protected]>
Cc: Simon Horman <[email protected]>
Signed-off-by: Sourabh Jain <[email protected]>
---
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