Commit c6e665c8f0c18ab3686117905765b5139efd6ebd

Authored by Rusty Russell
1 parent c6b3780191

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:
	<modname>: no version for "magic" found: kernel tainted.
New:
	<modname>: bad vermagic: kernel tainted.

Old:
	<modname>: no version for "nocrc" found: kernel tainted.
New:
	<modname>: no versions for exported symbols: kernel tainted.

Old:
	<modname>: no version for "<symname>" found: kernel tainted.
New:
	<modname>: <symname>: kernel tainted.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>

Showing 1 changed file with 6 additions and 6 deletions Side-by-side Diff

... ... @@ -990,12 +990,12 @@
990 990  
991 991 static const char vermagic[] = VERMAGIC_STRING;
992 992  
993   -static int try_to_force_load(struct module *mod, const char *symname)
  993 +static int try_to_force_load(struct module *mod, const char *reason)
994 994 {
995 995 #ifdef CONFIG_MODULE_FORCE_LOAD
996 996 if (!test_taint(TAINT_FORCED_MODULE))
997   - printk("%s: no version for \"%s\" found: kernel tainted.\n",
998   - mod->name, symname);
  997 + printk(KERN_WARNING "%s: %s: kernel tainted.\n",
  998 + mod->name, reason);
999 999 add_taint_module(mod, TAINT_FORCED_MODULE);
1000 1000 return 0;
1001 1001 #else
... ... @@ -2002,7 +2002,7 @@
2002 2002 modmagic = get_modinfo(sechdrs, infoindex, "vermagic");
2003 2003 /* This is allowed: modprobe --force will invalidate it. */
2004 2004 if (!modmagic) {
2005   - err = try_to_force_load(mod, "magic");
  2005 + err = try_to_force_load(mod, "bad vermagic");
2006 2006 if (err)
2007 2007 goto free_hdr;
2008 2008 } else if (!same_magic(modmagic, vermagic, versindex)) {
... ... @@ -2191,8 +2191,8 @@
2191 2191 || (mod->num_unused_gpl_syms && !mod->unused_gpl_crcs)
2192 2192 #endif
2193 2193 ) {
2194   - printk(KERN_WARNING "%s: No versions for exported symbols.\n", mod->name);
2195   - err = try_to_force_load(mod, "nocrc");
  2194 + err = try_to_force_load(mod,
  2195 + "no versions for exported symbols");
2196 2196 if (err)
2197 2197 goto cleanup;
2198 2198 }