Reputation: 5
I want to modify the address of the __NR_fork entry is the system call table
So i will make something like: sys_call_table_addr[__NR_fork] = newaddress;
But I want to change the read/write bits in the page table to be able to modify it Any hints on how to do that?
Upvotes: 0
Views: 324
Reputation: 2546
Not sure how this will work for your purposes, but in general the mechanisms for page tables are:
A page table walk to find the page table entry (pte
). Two ways I know how are manually, like how it's done in the __handle_mm_fault()
function defined here or with a walk_page_range()
call that does the walk for you with other helper walk functions defined here. Note that __handle_mm_fault()
leaves the last step of converting pmd
to pte
to the handle_pte_fault()
function.
Functions for modifying the page table entry (pte
) bits. Many relevant functions including pte_set_flags()
, pte_mkclean()
, pte_mkwrite()
, etc. are defined here
Upvotes: 1