diff options
author | Rusty Russell <rusty@rustcorp.com.au> | 2008-05-09 08:24:21 +0200 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-05-09 16:45:18 +0200 |
commit | a5dd69707424a35d2d2cc094e870f595ad61e916 (patch) | |
tree | dd9dffe6748358bac9a8699f7d8ad9e205886a67 /kernel/module.c | |
parent | module: put modversions in vermagic (diff) | |
download | linux-a5dd69707424a35d2d2cc094e870f595ad61e916.tar.xz linux-a5dd69707424a35d2d2cc094e870f595ad61e916.zip |
module: be more picky about allowing missing module versions
We allow missing __versions sections, because modprobe --force strips
it. It makes less sense to allow sections where there's no version
for a specific symbol the module uses, so disallow that.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel/module.c')
-rw-r--r-- | kernel/module.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/kernel/module.c b/kernel/module.c index 8e4528c9909f..2584c0e2762d 100644 --- a/kernel/module.c +++ b/kernel/module.c @@ -917,6 +917,10 @@ static int check_version(Elf_Shdr *sechdrs, if (!crc) return 1; + /* No versions at all? modprobe --force does this. */ + if (versindex == 0) + return try_to_force_load(mod, symname) == 0; + versions = (void *) sechdrs[versindex].sh_addr; num_versions = sechdrs[versindex].sh_size / sizeof(struct modversion_info); @@ -932,8 +936,9 @@ static int check_version(Elf_Shdr *sechdrs, goto bad_version; } - if (!try_to_force_load(mod, symname)) - return 1; + printk(KERN_WARNING "%s: no symbol version for %s\n", + mod->name, symname); + return 0; bad_version: printk("%s: disagrees about version of symbol %s\n", |