Search code examples
linuxlinux-kernelinterceptpage-faultkprobe

Kprobe mechanism to intercept do_page_fault


Im trying to intercept the __do_page_fault() method in linux kernel. The normal way to register kprobes , i.e. defining kp.addr as

kp.addr = (kprobe_opcode_t *) kallsyms_lookup_name("__do_page_fault");

is not working. What's the proper way to do this?

Edit: Any other method of intercepting do_page_fault will also work for me.


Solution

  • This error usually comes when GPL licenses are not used in the module. Adding the following lines in your module should remove this error :

    MODULE_LICENSE("GPL");
    MODULE_LICENSE("GPL v2");