module hideing after insertion

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi all,

I wrote the following code to hide the module after insertion.

#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/list.h>


static spinlock_t ime_lock = SPIN_LOCK_UNLOCKED;
static struct list_head ime_list = LIST_HEAD_INIT(ime_list);

int init_module(void)
{
struct list_head *tmp;
struct inter_module_entry *ime;

spin_lock(&ime_lock);
list_for_each(tmp, &ime_list) {
ime = list_entry(tmp, struct inter_module_entry, list);
printk("\n\t %s",ime->im_name);
if (strcmp(ime->im_name, "hidden_module") == 0) {
/*hidden_module is the name of module*/
printk("\n\t I am in hidden module");
list_del(&(ime->list));
spin_unlock(&ime_lock);
// kfree(ime);
return 0;
}
}
spin_unlock(&ime_lock);
return 0;
}

void cleanup_module()
{
printk("\n\t This function is not going to be executed");
}



But its not working. I can still get module name after lsmod command.
Can anybody please tell me whats wrong in the above code. It doesn't
list out the modules inserted into kernel also. Please guide me in the
above program.

Thanks in advance,
Deepak Joshi

Send instant messages to your online friends http://uk.messenger.yahoo.com


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux