[PATCH] module: log OOT_MODULE tainting

From: Jiri Kosina
Date: Mon Jan 02 2012 - 08:59:03 EST


Follow what we do with other taints and output a message into kernel ring
buffer once tainting a kernel because out-of-tree module is being loaded.

Signed-off-by: Jiri Kosina <jkosina@xxxxxxx>

diff --git a/kernel/module.c b/kernel/module.c
index b02d633..3f52b3e 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -2478,8 +2478,11 @@ static int check_modinfo(struct module *mod, struct load_info *info)
return -ENOEXEC;
}

- if (!get_modinfo(info, "intree"))
+ if (!get_modinfo(info, "intree")) {
add_taint_module(mod, TAINT_OOT_MODULE);
+ printk(KERN_WARNING "%s: out of tree module taints kernel\n",
+ mod->name);
+ }

if (get_modinfo(info, "staging")) {
add_taint_module(mod, TAINT_CRAP);
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/