public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] There should have a warn/log when out-of-tree module is loaded
@ 2014-02-21  8:13 Xudong Zhang
  2014-02-24  1:39 ` Rusty Russell
  0 siblings, 1 reply; 2+ messages in thread
From: Xudong Zhang @ 2014-02-21  8:13 UTC (permalink / raw)
  To: Rusty Russell; +Cc: linux-kernel, felixmelon

I can not get any hint when I found that my kernel is tainted (out of
tree module is loaded). And I checked all loaded and loadable modules
but it showed that all of them are intree modules.
I think we need a warn when out of tree module is loaded.

Signed-off-by: Xudong Zhang <xdzhang@suse.com>
---
 kernel/module.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/kernel/module.c b/kernel/module.c
index efa1e60..f80739f 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -2681,8 +2681,11 @@ static int check_modinfo(struct module *mod, struct load_info *info, int flags)
 		return -ENOEXEC;
 	}
 
-	if (!get_modinfo(info, "intree"))
+	if (!get_modinfo(info, "intree")) {
 		add_taint_module(mod, TAINT_OOT_MODULE, LOCKDEP_STILL_OK);
+		pr_warn("%s: out-of-tree module is loaded, kernel tainted.\n",
+				mod->name);
+	}
 
 	if (get_modinfo(info, "staging")) {
 		add_taint_module(mod, TAINT_CRAP, LOCKDEP_STILL_OK);
-- 
1.8.4.5


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] There should have a warn/log when out-of-tree module is loaded
  2014-02-21  8:13 [PATCH] There should have a warn/log when out-of-tree module is loaded Xudong Zhang
@ 2014-02-24  1:39 ` Rusty Russell
  0 siblings, 0 replies; 2+ messages in thread
From: Rusty Russell @ 2014-02-24  1:39 UTC (permalink / raw)
  To: Xudong Zhang; +Cc: linux-kernel, felixmelon

Xudong Zhang <xdzhang@suse.com> writes:
> I can not get any hint when I found that my kernel is tainted (out of
> tree module is loaded). And I checked all loaded and loadable modules
> but it showed that all of them are intree modules.
> I think we need a warn when out of tree module is loaded.
>
> Signed-off-by: Xudong Zhang <xdzhang@suse.com>

This would be an escalation.

This taint only has an effect on oops messages, and
/proc/sys/kernel/tainted.

Cheers,
Rusty.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-02-24  3:40 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-21  8:13 [PATCH] There should have a warn/log when out-of-tree module is loaded Xudong Zhang
2014-02-24  1:39 ` Rusty Russell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox