]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commitdiff
s390/kdump: Use "LINUX" ELF note name instead of "CORE"
authorMichael Holzheu <holzheu@linux.vnet.ibm.com>
Tue, 7 Feb 2017 17:09:14 +0000 (18:09 +0100)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Fri, 17 Feb 2017 06:40:25 +0000 (07:40 +0100)
In binutils/libbfd (bfd/elf.c) it is enforced that all s390 specific ELF
notes like e.g. NT_S390_PREFIX or NT_S390_CTRS have "LINUX" specified
as note name. Otherwise the notes are ignored.

For /proc/vmcore we currently use "CORE" for these notes.

Up to now this has not been a real problem because the dump analysis tool
"crash" does not check the note name. But it will break all programs that
use libbfd for processing ELF notes.

So fix this and use "LINUX" for all s390 specific notes to comply with
libbfd.

Cc: stable@vger.kernel.org # v4.4+
Reported-by: Philipp Rudo <prudo@linux.vnet.ibm.com>
Reviewed-by: Philipp Rudo <prudo@linux.vnet.ibm.com>
Signed-off-by: Michael Holzheu <holzheu@linux.vnet.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
arch/s390/kernel/crash_dump.c

index f9293bfefb7fe465cf55959c2874cb5c94d5a2ff..408b4f4fda0f80fb5fafaf9777ba408ada2c3f4f 100644 (file)
@@ -329,7 +329,11 @@ static void *nt_init_name(void *buf, Elf64_Word type, void *desc, int d_len,
 
 static inline void *nt_init(void *buf, Elf64_Word type, void *desc, int d_len)
 {
-       return nt_init_name(buf, type, desc, d_len, KEXEC_CORE_NOTE_NAME);
+       const char *note_name = "LINUX";
+
+       if (type == NT_PRPSINFO || type == NT_PRSTATUS || type == NT_PRFPREG)
+               note_name = KEXEC_CORE_NOTE_NAME;
+       return nt_init_name(buf, type, desc, d_len, note_name);
 }
 
 /*