Linux Headquarters
[ Register ]
[ About us ] [ Home Page ]

Advertisement
[ Kernel ] [ Documentation ] [ Links ] [ Books ]

Advertisement

Kernel v2.6.24 /scripts/mod/modpost.c

Filename:/scripts/mod/modpost.c
Lines Added:10
Lines Deleted:0
Also changed in: (Previous) 2.6.24-rc8  2.6.24-rc7  2.6.24-rc6  2.6.24-rc5  2.6.24-rc4  2.6.24-rc3 
(Following) 2.6.24-git6  2.6.24-git7  2.6.24-git8  2.6.24-git9  2.6.24-git10  2.6.24-git11 

Location
[  2.6.24
  [  scripts
    [  mod
       o  modpost.c

Patch

diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index 6c145d6..93ac52a 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -268,6 +268,9 @@ static struct symbol *sym_add_exported(const char *name, struct module *mod,
               "was in %s%s\n", mod->name, name,
               s->module->name,
               is_vmlinux(s->module->name) ?"":".ko");
+      } else {
+         /* In case Modules.symvers was out of date */
+         s->module = mod;
       }
    }
    s->preloaded = 0;
@@ -381,6 +384,12 @@ static int parse_elf(struct elf_info *info, const char *filename)
    sechdrs = (void *)hdr + hdr->e_shoff;
    info->sechdrs = sechdrs;
 
+   /* Check if file offset is correct */
+   if (hdr->e_shoff > info->size) {
+      fatal("section header offset=%u in file '%s' is bigger then filesize=%lu\n", hdr->e_shoff, filename, info->size);
+      return 0;
+   }
+
    /* Fix endianness in section headers */
    for (i = 0; i < hdr->e_shnum; i++) {
       sechdrs[i].sh_type   = TO_NATIVE(sechdrs[i].sh_type);
@@ -709,6 +718,7 @@ static int secref_whitelist(const char *modname, const char *tosec,
 
    /* Check for pattern 0 */
    if ((strncmp(fromsec, ".text.init.refok", strlen(".text.init.refok")) == 0) ||
+       (strncmp(fromsec, ".exit.text.refok", strlen(".exit.text.refok")) == 0) ||
        (strncmp(fromsec, ".data.init.refok", strlen(".data.init.refok")) == 0))
       return 1;
 


Comments: webmaster (at) linuxhq.com.
Advertising: banners (at) linuxhq.com.
Compilation ©1998-2008 Linux Headquarters, Inc.