We get Oopses when loading stripped modules... and they are useless. I hope this patch will detect them. Signed-off-by: Paolo 'Blaisorblade' Giarrusso --- vanilla-linux-2.6.7-SKAS-paolo/kernel/module.c | 10 +++++++++- 1 files changed, 9 insertions(+), 1 deletion(-) diff -puN kernel/module.c~reject-stripped-module kernel/module.c --- vanilla-linux-2.6.7-SKAS/kernel/module.c~reject-stripped-module 2004-08-19 11:34:11.000000000 +0200 +++ vanilla-linux-2.6.7-SKAS-paolo/kernel/module.c 2004-08-19 15:03:31.927895368 +0200 @@ -1456,7 +1456,8 @@ static struct module *load_module(void _ secstrings = (void *)hdr + sechdrs[hdr->e_shstrndx].sh_offset; sechdrs[0].sh_addr = 0; - /* And these should exist, but gcc whinges if we don't init them */ + /* And these should exist, but somebody could have stripped + * the module (yes, I did)*/ symindex = strindex = 0; for (i = 1; i < hdr->e_shnum; i++) { @@ -1481,6 +1482,13 @@ static struct module *load_module(void _ #endif } + /*Oh, somebody fsck'ed it. Please, remember root != God ! */ + if (symindex == 0) { + printk(KERN_ERR "Trying to load stripped module!!\n"); + err = -ENOEXEC; + goto free_hdr; + } + modindex = find_sec(hdr, sechdrs, secstrings, ".gnu.linkonce.this_module"); if (!modindex) { _