From: Rusty Russell Date: Tue, 31 Mar 2009 19:05:33 +0000 (-0600) Subject: module: clarify the force-loading taint message. X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=c6e665c8f0c18ab3686117905765b5139efd6ebd;p=linux-beck.git module: clarify the force-loading taint message. Impact: Message cleanup Two of three callers of try_to_force_load() are not because of a missing version, so change the messages: Old: : no version for "magic" found: kernel tainted. New: : bad vermagic: kernel tainted. Old: : no version for "nocrc" found: kernel tainted. New: : no versions for exported symbols: kernel tainted. Old: : no version for "" found: kernel tainted. New: : : kernel tainted. Signed-off-by: Rusty Russell --- diff --git a/kernel/module.c b/kernel/module.c index 5fd00766a4dc..599fc85bd2cc 100644 --- a/kernel/module.c +++ b/kernel/module.c @@ -990,12 +990,12 @@ static struct module_attribute *modinfo_attrs[] = { static const char vermagic[] = VERMAGIC_STRING; -static int try_to_force_load(struct module *mod, const char *symname) +static int try_to_force_load(struct module *mod, const char *reason) { #ifdef CONFIG_MODULE_FORCE_LOAD if (!test_taint(TAINT_FORCED_MODULE)) - printk("%s: no version for \"%s\" found: kernel tainted.\n", - mod->name, symname); + printk(KERN_WARNING "%s: %s: kernel tainted.\n", + mod->name, reason); add_taint_module(mod, TAINT_FORCED_MODULE); return 0; #else @@ -2002,7 +2002,7 @@ static noinline struct module *load_module(void __user *umod, modmagic = get_modinfo(sechdrs, infoindex, "vermagic"); /* This is allowed: modprobe --force will invalidate it. */ if (!modmagic) { - err = try_to_force_load(mod, "magic"); + err = try_to_force_load(mod, "bad vermagic"); if (err) goto free_hdr; } else if (!same_magic(modmagic, vermagic, versindex)) { @@ -2191,8 +2191,8 @@ static noinline struct module *load_module(void __user *umod, || (mod->num_unused_gpl_syms && !mod->unused_gpl_crcs) #endif ) { - printk(KERN_WARNING "%s: No versions for exported symbols.\n", mod->name); - err = try_to_force_load(mod, "nocrc"); + err = try_to_force_load(mod, + "no versions for exported symbols"); if (err) goto cleanup; }