Re: Error message not relevant

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

 



On Wed, Nov 20, 2013 at 11:43 PM, Nav Kamal <navkamal90@xxxxxxxxx> wrote:
> Am learning to write LKMs and wrote this program :
>
> #include<linux/init.h>
> #include<linux/module.h>
> static int module_entry(void){
>         printk(KERN_ALERT "Hello World !!\n");
>         return 0;
> }
> static void exit_module(void){
>         printk(KERN_ALERT "Bye World .... \n");
> }
> module_init(module_entry);
> module_exit(exit_module);
>
> 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 :
>
> "insmod: ERROR: could not insert module test.ko: Operation not permitted"
>
> 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
> ?

AFAIK, insmod/modprobe translate any errors during module load as "not
permitted". This doesn't mean you can not read the .ko files, it just
means you can't load it.

-- 
regards,

Mulyadi Santosa
Freelance Linux trainer and consultant

blog: the-hydra.blogspot.com
training: mulyaditraining.blogspot.com

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies




[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