Custom Page Errors and Exception Handlers

I'm trying to figure out if we can add handlers handlers errors / exceptions in the kernel / user mode strong> and process error caused by contact before returning control to the kernel. The task here will not modify the existing kernel code ( do_page_fault fn ), but add a user-defined handler that will be viewed when a page error or exception is triggered .

You can find tools like " kprobe " that provide binding to instructions, but it doesn't seem to serve my purpose.

It will be great if someone can help me figure this out or point out some good links.

+3
source share
4 answers

From the user space, you can define a signal handler for SIGSEGV, so your own function will be called whenever an invalid memory access is made. Combined with mprotect()this, it allows the program to manage its own virtual memory, all from user space.

, (, ) . , . , do_page_fault(). , . , - (.. ).

+2

, ​​ , kprobes . , , , , . , ( ), jprobes ( - ), , ( /).

jprobes .

+1

, - , - , .

-, , , , , , , , , .

, , .

0

gnu libsegsev. , , , , .

0

All Articles