LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
LinkBack Search this Thread
Old 04-02-2008, 01:23 AM   #1
nikhil86
LQ Newbie
 
Registered: Apr 2007
Posts: 17

Rep: Reputation: 0
insmod: error inserting 'm2.ko': -1 Invalid parameters


Hi,
I'm writing a simple LSM module, but i'm getting the following error:

#insmod m2.ko
insmod: error inserting 'm2.ko': -1 Invalid parameters

My code has blank bodies (they return 0) for the LSM hook functions...
static struct security_operations my_security_ops =
{
.inode_permission = my_inode_permission,
.inode_unlink = my_inode_unlink
};

static __init int my_init_module()
{
if (register_security(&my_security_ops)) {
printk(KERN_INFO"Failure registering 'my_security_module' as primary security module\n");
if (mod_reg_security("my_security_module", &my_security_ops)) {
printk(KERN_INFO"Failure registering 'my_security_module' as secondary module\n");
return -EINVAL;
}
}
return 0;
}

My syslog shows the following though:
Apr 2 16:11:27 localhost kernel: Failure registering 'my_security_module' as primary security module
Apr 2 16:11:27 localhost kernel: Failure registering 'my_security_module' as secondary module
 
Old 04-02-2008, 09:26 PM   #2
osor
HCL Maintainer
 
Registered: Jan 2006
Distribution: (H)LFS, Gentoo
Posts: 2,450

Rep: Reputation: 64
Why not see the return value of each function (which is most likely the negative of the errno associated with the problem).
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
insmod: error inserting in 2.6 masg Linux - Newbie 3 03-15-2007 09:45 PM
insmod: error inserting 'usbip.ko': -1 Invalid module format barunparichha Linux - Software 1 01-13-2007 09:51 PM
insmod: error inserting 'module.o': -1 Invalid module format ksrinivas Linux - Newbie 5 10-11-2006 08:29 AM
insmod: error inserting 'new.ko': -1 Invalid module format hemk76 Programming 2 01-26-2005 11:52 AM
insmod: error inserting 'new.ko': -1 Invalid module format hemk76 Programming 2 01-24-2005 11:42 AM


All times are GMT -5. The time now is 07:41 PM.

Main Menu
 
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration