lkml.org 
[lkml]   [2012]   [May]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 29/29] MODSIGN: Suppress some redundant ELF checks [ver #4]
Date
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@redhat.com>
---

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;


\
 
 \ /
  Last update: 2012-05-11 02:21    [W:1.924 / U:0.216 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site