diff options
author | Vivek Goyal <vgoyal@in.ibm.com> | 2006-11-16 12:43:31 -0500 |
---|---|---|
committer | Simon Horman <horms@verge.net.au> | 2006-11-20 10:40:18 +0900 |
commit | 4e74957bef2f2cd3692b0c4f40deb589cecd673c (patch) | |
tree | 7102042064015f26e0f12b6ff75c08755db58015 /kexec/kexec-elf.c | |
parent | 93fa57c2b75b1bbfccf2e202c10e23a708c6c7e7 (diff) |
kexec-tools: Don't create hardcoded PT_LOAD header (x86_64)
o In kernels 2.6.18 and older, /proc/kcore elf note name length does not
take into the picture the null character size. Kexec-tools very religiously
checks for it and fails parsing /proc/kcore in older kernels. In newer
kernels (2.6.19-rc) this problem has been fixed.
o This is not a very serious condition and instead of failing we can simply
warn user about this condition and continue processing. This ensures
backward compatibility with older kernels.
Signed-off-by: Vivek Goyal <vgoyal@in.ibm.com>
Moved a whites pace change, and a fix for assumptions of a 2Mb start address
to a separate patch.
Signed-off-by: Simon Horman <horms@verge.net.au.
Diffstat (limited to 'kexec/kexec-elf.c')
-rw-r--r-- | kexec/kexec-elf.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/kexec/kexec-elf.c b/kexec/kexec-elf.c index 18b857f..2ad2b73 100644 --- a/kexec/kexec-elf.c +++ b/kexec/kexec-elf.c @@ -715,8 +715,14 @@ static int build_mem_notes(const char *buf, off_t len, struct mem_ehdr *ehdr) note_size += (hdr.n_descsz + 3) & ~3; if ((hdr.n_namesz != 0) && (name[hdr.n_namesz -1] != '\0')) { - fprintf(stderr, "Note name is not null termiated\n"); - return -1; + /* If note name string is not null terminated, just + * warn user about it and continue processing. This + * allows us to parse /proc/kcore on older kernels + * where /proc/kcore elf notes were not null + * terminated. It has been fixed in 2.6.19. + */ + fprintf(stderr, "Warning: Elf Note name is not null " + "terminated\n"); } ehdr->e_note[i].n_type = hdr.n_type; ehdr->e_note[i].n_name = (char *)name; |