mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [RFC][TRIVIAL] Print a KERN_INFO after a module gets loaded
@ 2002-06-15  5:27 Robinson Maureira Castillo
  2002-06-15  8:09 ` Zwane Mwaikambo
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Robinson Maureira Castillo @ 2002-06-15  5:27 UTC (permalink / raw)
  To: linux-kernel

Hi all,

After some thinking (nothing serious) I came up with the idea of print a 
KERN_INFO after a module got loaded, why? Think about this, some guy 
inserts a LKM rootkit, obviously that module (think adore or knark) 
doesn't say anything when it gets loaded. In this cases is useful to have 
this feature, another example can be simply now the order of a group of 
pre-requisite modules when you load something using modprobe(8).

Before doing this I searched the web, readed some docs and asked on 
#kernelnewbies, it seems there's no standard way to log the insertion of a 
module.

I'm not sure if this is the right way to do this, I'm just adding a printk 
after the module gets initialized, perhaps it must be done somewhere else, 
comments/flames are welcome.

This is pretty useful, at least for me 8) (the printk, not the flames)

Best Regards 

PS: Oops, I forgot, this applies happily against 2.4.18 and 2.5.21

diff -Nrua linux/kernel/module.c linux-info/kernel/module.c
--- linux/kernel/module.c       Sat Jun 15 01:00:24 2002
+++ linux-info/kernel/module.c  Sat Jun 15 01:02:37 2002
@@ -560,6 +560,7 @@
 
        /* And set it running.  */
        mod->flags = (mod->flags | MOD_RUNNING) & ~MOD_INITIALIZING;
+       printk(KERN_INFO "module: %s loaded\n", mod->name);
        error = 0;
        goto err0;

-- 
Robinson Maureira Castillo
Asesor DAI
INACAP


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

end of thread, other threads:[~2002-06-16  6:24 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-06-15  5:27 [RFC][TRIVIAL] Print a KERN_INFO after a module gets loaded Robinson Maureira Castillo
2002-06-15  8:09 ` Zwane Mwaikambo
2002-06-15 15:18   ` Robinson Maureira Castillo
2002-06-15 22:41     ` Oliver Xymoron
2002-06-16  1:10 ` Horst von Brand
2002-06-16  6:24 ` Keith Owens

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

all inboxes | Powered by JetHome®