summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--kexec/arch/x86_64/crashdump-x86_64.c1
-rw-r--r--kexec/kexec-elf.c10
2 files changed, 6 insertions, 5 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;
}
diff --git a/kexec/kexec-elf.c b/kexec/kexec-elf.c
index 1cdae36..75396ce 100644
--- a/kexec/kexec-elf.c
+++ b/kexec/kexec-elf.c
@@ -390,11 +390,11 @@ static int build_mem_phdrs(const char *buf, off_t len, struct mem_ehdr *ehdr,
phdr_size *= ehdr->e_phnum;
if ((uintmax_t)(ehdr->e_phoff + phdr_size) > (uintmax_t)len) {
/* The program header did not fit in the file buffer */
- fprintf(stderr, "%d segments require a %ld-byte buffer\n",
- ehdr->e_phnum, ehdr->e_phoff + phdr_size);
- fprintf(stderr, "KCORE_ELF_HEADERS_SIZE %d too small\n", KCORE_ELF_HEADERS_SIZE);
- if (probe_debug) {
- fprintf(stderr, "ELF program segment truncated\n");
+ if (probe_debug || (flags & ELF_SKIP_FILESZ_CHECK)) {
+ fprintf(stderr, "ELF program headers truncated"
+ " have %ju bytes need %ju bytes\n",
+ (uintmax_t)len,
+ (uintmax_t)(ehdr->e_phoff + phdr_size));
}
return -1;
}