summaryrefslogtreecommitdiff
path: root/kexec/arch
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2010-09-07 20:31:03 -0700
committerSimon Horman <horms@verge.net.au>2010-09-09 17:02:54 +0900
commitb16f811bb13c44e24425ee96d848ca04838b7d77 (patch)
tree1b09f35b3753a6e4ed64295ca40ec4451ff7304f /kexec/arch
parent5944fe4d86abf4571dbf915c4ea31cc1a5e3351d (diff)
kexec elf: Clean up error messages build_mem_phdrs
Don't print uncondintionally print an error message about KCORE_ELF_HEADERS_SIZE being wrong when the elf headers are truncated when build_mem_phdrs fails because there are other reasons we could be truncated (like an actual damaged elf file). Instead only print an error message when either probe_debug is true or we are skipping the total file size checks for some reason. When we do print an error message limit the message to the fact that we are truncated and how many bytes we have and how many bytes we need. The context of the failure should be able to provide the rest of the information. For now add a comment in crashdump-x86_64.c to direct people to KCORE_ELF_HEADERS_SIZE so that if someone finds the code things can be adjusted. Signed-off-by: Eric W. Biederman <ebiederm@xmission.com> Signed-off-by: Simon Horman <horms@verge.net.au>
Diffstat (limited to 'kexec/arch')
-rw-r--r--kexec/arch/x86_64/crashdump-x86_64.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/kexec/arch/x86_64/crashdump-x86_64.c b/kexec/arch/x86_64/crashdump-x86_64.c
index a6ad89c..fc2dd91 100644
--- a/kexec/arch/x86_64/crashdump-x86_64.c
+++ b/kexec/arch/x86_64/crashdump-x86_64.c
@@ -120,6 +120,7 @@ static int get_kernel_vaddr_and_size(struct kexec_info *info,
elf_flags |= ELF_SKIP_FILESZ_CHECK;
result = build_elf_core_info(buf, size, &ehdr, elf_flags);
if (result < 0) {
+ /* Perhaps KCORE_ELF_HEADERS_SIZE is too small? */
fprintf(stderr, "ELF core (kcore) parse failed\n");
return -1;
}