I have a process PID that access a memory region that it's not allowed to, the CPU creates a trap into the kernel which calls do_page_fault() which will send SIGSEGV to the user process. The user process has a custom signal handler that has some logic and the faulting instruction is resumed. What I want to do is to move this signal handler logic to kernel space and prevent SIGSEGV from being sent. For that could I write a kernel module that hijacks the fault handler for this PID or something? or do I have to add my logic to do_page_fault()? Some guidance would be helpful.
Hijacking page fault handler
488 Views Asked by ruke At
1
There are 1 best solutions below
Related Questions in LINUX-KERNEL
- kernel module does not print packet info
- android linux kernel communicate with user space about NETLINK_USER
- How to offload NAPI poll function to workqueue
- Why Device Tree Structure (DTS) file is needed both in bootloader and kernel source code?
- Bootloader in Assembly with Linux kernel
- pktgen not sending packets more than 1kb big
- Use static analysis tools to check null pointers and memory leaks in Linux device drivers
- How to build Linux kernel to support SO_ATTACH_BPF socket option?
- How do I know the last sched time of a process
- linux kernel compile error....udevd[63]: error getting socket
- Process in background mode trying to read from stdin
- board firmware update through uefi capsule feature from Linux
- spin_lock before writing status register
- Kernel module configuration locked built in?
- Install Subversion 1.7 on Debian jessie
Related Questions in SEGMENTATION-FAULT
- C Reading binary file with fread()
- Vector of Vector of object
- opencv::mixchannels segmentation fault
- Why is the following convert command resulting in Segmentation fault?
- Xamarin Android Crash on Start "Got a SIGSEGV"
- Segmentation fault when using if statement with pointers (BST tree)
- C++ boost graph library segmentation fault with adjacency_iterator
- Segmentation fault while trying to test fgets()
- Closed system shellcode experimentation (segfault)
- Segmentation Fault in the given Program
- Variable without initialization returns segmentation fault
- Why realloc of char** gives Address is 0 bytes after alloc'd
- SDL_Keycodes are too big for storage
- Delete raw pointer after creating a shared_ptr from it
- segmentation fault in height balance tree code
Related Questions in KERNEL-MODULE
- Insmod is not working
- Different privileges in kernel module execution
- "Segmentation fault" when `rmmod` or `modprobe -r`
- Intercept ELF loader in linux kernel: fs/binfmt_elf.c file via loadable kernel module
- Best way to handle ERESTARTSYS in kthread?
- In linux every process is given a 4GB of virtual address space considering a 32-bit architecture
- Missing headers for kernel in bzImage loaded on qemu
- A better way than printk() to leave a kernel module log?
- Unknown symbol in module
- How to call make kernel module calls or disable interrupts?
- insmod not throwing error for a positive return
- Cannot understand what "error: initializer element is not constant" means
- Why is the probe function in my kernel module not being called?
- How to identify *.ko file given CONFIG_* name?
- Example of use pwm_get() in linux kernel
Related Questions in PAGE-FAULT
- want to compile userfaultfd ecample
- How many minor faults is my process *really* taking?
- Instruction pointer value after the page fault trap has been handled
- FIFO Page Replacement Algorithm - Counting Page Faults
- What cause kernel to eat CPU on page_fault?
- Android illegal memory access - who and how is it handled?
- When a page fault happens in user application, what is current pid when kernel handler this fault
- Calculating number of page faults in two dimensional array
- Where does the OS get the needed disk address when page fault happens from?
- Why using rg(ripgrep) with mmap triggers more minor page faults?
- Getting "GPU page fault" by initializing data in a kernel
- Avoiding minor page faults in a C++ program with g++
- What are the semantics of VM_UFFD_MISSING?
- Difference in how the page fault handler handles read vs write access requests?
- How do I determine the page number from the virtual address?
Related Questions in MPROTECT
- Solving mprotect() syscall failure
- Make all pages readable/writable/executable
- create member function name and call it at runtime in c++
- mprotect always returns invalid arguments
- Calculate align page of an address statically
- C write/read detection on memory block
- memory mapped with mmap, and used with mprotect
- Using page protection to surface pointer/iterator invalidation bugs
- Why is my mprotect function called with 5 arguments?
- numa: next-touch policy
- linux c mmap/mprotect issue
- What is the difference between these alignment functions?
- Hijacking page fault handler
- calling mprotect in kernel module
- mprotect : how is memory protection implemented
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
userfaultfd() could be useful to you. It allows you to handle page faults in usermode.