ppc64: Reserve FDT memory for full elfcorehdr memory size
Subsystems (2)
PATCH 1/1 ppc64: Reserve FDT memory for full elfcorehdr memory size
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.
--- kexec/arch/ppc64/crashdump-ppc64.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kexec/arch/ppc64/crashdump-ppc64.c +1 -1
@@ -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 */
Signature · 1 line
2.52.0
Simon Horman
AppliedQuoted 5 lines · Sourabh Jain
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.
Quoted 8 lines
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]>
Thanks, applied.
- ppc64: Reserve FDT memory for full elfcorehdr memory size
https://git.kernel.org/pub/scm/utils/kernel/kexec/kexec-tools.git/commit/?id=600c2f9512b5