[PATCH 29/29] MODSIGN: Suppress some redundant ELF checks [ver #4]

From: David Howells
Date: Thu May 10 2012 - 19:44:45 EST


Suppress some redundant ELF checks in module_verify_elf() that are also done
by copy_and_check() in the core module loader code prior to calling
module_verify().

Signed-off-by: David Howells <dhowells@xxxxxxxxxx>
---

kernel/module-verify.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)


diff --git a/kernel/module-verify.c b/kernel/module-verify.c
index a31b39c..e1bfd28 100644
--- a/kernel/module-verify.c
+++ b/kernel/module-verify.c
@@ -76,7 +76,7 @@ static noinline int module_verify_elf(struct module_verify_data *mvdata)
const Elf_Shdr *section, *secstop;
const Elf_Sym *symbols, *symbol, *symstop;
const char *strtab;
- size_t size, secsize, secstrsize, strsize, notesize, notemetasize;
+ size_t size, secstrsize, strsize, notesize, notemetasize;
unsigned line;

size = mvdata->size;
@@ -96,11 +96,11 @@ do { if (unlikely(!(X))) { line = __LINE__; goto symcheck_error; } } while(0)

elfcheck(hdr->e_shnum < SHN_LORESERVE);
elfcheck(hdr->e_shstrndx < hdr->e_shnum);
- elfcheck(hdr->e_shentsize == sizeof(Elf_Shdr));
- elfcheck(hdr->e_shoff < size);
+ /* elfcheck(hdr->e_shentsize == sizeof(Elf_Shdr)); */
+ /* elfcheck(hdr->e_shoff < size); */
elfcheck(hdr->e_shoff >= hdr->e_ehsize);
elfcheck(hdr->e_shoff % sizeof(long) == 0);
- elfcheck(hdr->e_shnum * sizeof(Elf_Shdr) <= size - hdr->e_shoff);
+ /* elfcheck(hdr->e_shnum * sizeof(Elf_Shdr) <= size - hdr->e_shoff); */

/* Validate the section table contents */
mvdata->nsects = hdr->e_shnum;

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/