From: Cyrill Gorcunov Date: Wed, 14 May 2008 23:27:29 +0000 (-0700) Subject: module loading ELF handling: use SELFMAG instead of numeric constant X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=c4ea6fcf5a192dbba54666f308bdace1c278e0c1;p=openwrt%2Fstaging%2Fblogic.git module loading ELF handling: use SELFMAG instead of numeric constant Signed-off-by: Cyrill Gorcunov Signed-off-by: Andrew Morton Signed-off-by: Rusty Russell --- diff --git a/kernel/module.c b/kernel/module.c index f5e9491ef7ac..e6daf9a320a7 100644 --- a/kernel/module.c +++ b/kernel/module.c @@ -1780,7 +1780,7 @@ static struct module *load_module(void __user *umod, /* Sanity checks against insmoding binaries or wrong arch, weird elf version */ - if (memcmp(hdr->e_ident, ELFMAG, 4) != 0 + if (memcmp(hdr->e_ident, ELFMAG, SELFMAG) != 0 || hdr->e_type != ET_REL || !elf_check_arch(hdr) || hdr->e_shentsize != sizeof(*sechdrs)) {