From eef0dd4fa4205a47ab3f8c4608936f7128f1c10c Mon Sep 17 00:00:00 2001 From: Marc Hartmayer Date: Mon, 15 Nov 2021 10:58:44 +0100 Subject: [PATCH] zdump: df_elf: add missing endianness check MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A s390x ELF file must use big-endian encoding. Signed-off-by: Marc Hartmayer Reviewed-by: Alexander Egorenkov Reviewed-by: Steffen Eiden Signed-off-by: Jan Höppner --- zdump/df_elf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/zdump/df_elf.c b/zdump/df_elf.c index 7d02a608..1b88a328 100644 --- a/zdump/df_elf.c +++ b/zdump/df_elf.c @@ -48,7 +48,7 @@ bool ehdr_is_vmcore(const Elf64_Ehdr *ehdr) bool ehdr_is_s390x(const Elf64_Ehdr *ehdr) { - return ehdr->e_machine == EM_S390 && + return ehdr->e_machine == EM_S390 && ehdr->e_ident[EI_DATA] == ELFDATA2MSB && ehdr->e_ident[EI_CLASS] == ELFCLASS64; }