I am in the Linux kernel module and I am allocating some memory, say vmalloc() . I want the memory to read, write, and execute permission. What is a clean and suitable way to do this? Basically, this is usually the equivalent of calling mprotect() , but in kernel space.
If I browse the page, pgd_offset() , pud_offset() , pmd_offset() , pte_offset_map() and then pte_mkwrite() , I encounter bind errors when I tried it on 2.6.39. In addition, it seems that if I make a page move, it is hacking, and there should be a cleaner and more suitable method.
My kernel module will be a loadable module, so the internal characters are not available to me.
Thanks in advance for your guidance.
source share