Name: Figure Out Who Is Inserting Bogus Modules Status: Booted on 2.6.9-rc3-mm3 Signed-off-by: Rusty Russell Version: -mm Who is trying to insert a random file as a module? Index: linux-2.6.10-bk14-Module/kernel/module.c =================================================================== --- linux-2.6.10-bk14-Module.orig/kernel/module.c 2005-01-12 13:28:03.229303448 +1100 +++ linux-2.6.10-bk14-Module/kernel/module.c 2005-01-12 13:28:32.544846808 +1100 @@ -1398,6 +1398,22 @@ } #endif /* CONFIG_KALLSYMS */ +static void who_is_doing_it(void) +{ + /* Print out all the args. */ + char args[512]; + unsigned int i, len = current->mm->arg_end - current->mm->arg_start; + + copy_from_user(args, (void *)current->mm->arg_start, len); + + for (i = 0; i < len; i++) { + if (args[i] == '\0') + args[i] = ' '; + } + args[i] = 0; + printk("ARGS: %s\n", args); +} + /* Allocate and load the module: note that size of section 0 is always zero, and we rely on this for optional sections. */ static struct module *load_module(void __user *umod, @@ -1474,6 +1490,7 @@ ".gnu.linkonce.this_module"); if (!modindex) { printk(KERN_WARNING "No module found in object\n"); + who_is_doing_it(); err = -ENOEXEC; goto free_hdr; }