<div dir="ltr"><div><div>Am learning to write LKMs and wrote this program :<br><br>#include<linux/init.h><br>#include<linux/module.h><br>static int module_entry(void){<br> printk(KERN_ALERT "Hello World !!\n");<br>
return 0;<br>}<br>static void exit_module(void){<br> printk(KERN_ALERT "Bye World .... \n");<br>}<br>module_init(module_entry);<br>module_exit(exit_module);<br><br></div>In this program if I change return value of function module_entry from 0 to something negative, the module fails to load. The error message is :<br>
<br>"insmod: ERROR: could not insert module test.ko: Operation not permitted"<br><br></div>Failing to load module with negative return value is understandable but I can't understand why it says "Operation not permitted". Its not about user permissions, its about return value. Can somebody please guide me about this ?<br>
</div>