From 8e3260cbf1374504ccbcc0c3226ed2c0916bca8a Mon Sep 17 00:00:00 2001 From: Alex Kotov Date: Wed, 25 Nov 2020 23:24:15 +0500 Subject: [PATCH] Revert "More strict verification of ELF header" This reverts commit e3ebea5d9a99087569e1113b57d9082c9e619efb. --- kernelmq/elf.h | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/kernelmq/elf.h b/kernelmq/elf.h index 5298d0f..710a4a4 100644 --- a/kernelmq/elf.h +++ b/kernelmq/elf.h @@ -21,13 +21,13 @@ struct KernelMQ_ELF_Header { unsigned long elf_version : 32; // Must be 1. unsigned long entrypoint : 32; unsigned long prog_table_pos : 32; // Must not be 0. - unsigned long sect_table_pos : 32; // Must not be 0. + unsigned long sect_table_pos : 32; unsigned long arch_flags : 32; // Must be 0. unsigned short header_size : 16; // Must be 52. unsigned short prog_entr_size : 16; // Must not be 0. unsigned short prog_entr_num : 16; // Must not be 0. - unsigned short sect_entr_size : 16; // Must not be 0. - unsigned short sect_entr_num : 16; // Must not be 0. + unsigned short sect_entr_size : 16; + unsigned short sect_entr_num : 16; unsigned short sect_names_idx : 16; } __attribute__((packed)); @@ -85,10 +85,7 @@ unsigned char KernelMQ_ELF_Header_is_valid( header->header_size == 52 && header->prog_table_pos != 0 && header->prog_entr_size != 0 && - header->prog_entr_num != 0 && - header->sect_table_pos != 0 && - header->sect_entr_size != 0 && - header->sect_entr_num != 0 + header->prog_entr_num != 0 ); }