Omar Osman
Omar Osman

Reputation: 5

modify page table read/write bits to modify system call table

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

Answers (1)

wxz
wxz

Reputation: 2546

Not sure how this will work for your purposes, but in general the mechanisms for page tables are:

  1. 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.

  2. 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

Related Questions