Hello,
I am trying to make pmd level of the translation table as read only so that any writes in the pte entries should cause a permission fault.
Current steps which i am doing are:
1) inside kernel space, allocating 2 pointers (say p, q) and allocating memory using vmalloc (4k size to occupy entire page)
2) assigning int data to both (say p=10, q= 20)
3) setting APTable bit for readonly for both the pointers (By reading manual, bit 61 and 62 denotes APTable)
4) swapping pte value for both the pointer in translation table
5) printing value for both the pointer
At step 4, access permission fault is not occurring.
I tried flushing the TLB, still at point 4 fault does not occur, but fault is occurring at random places (sometimes after point 5 or in between any points)
Can anyone tell me possible reasons why this is happening or some solution to fix it?
thanks
Not sure what you really want to achieve. Is this academic or do you need this for something real?But IIRC the Linux page table and the hardware page table are different.And making the page table read-only in kernel space makes no sense to me. The kernel has to modify it.
This is for academic purpose. We are trying to do something similar to "Hypervision across worlds" paper, where secure world makes page table changes for the kernel.
42Bastian Schick said:But IIRC the Linux page table and the hardware page table are different.
what do you mean by this?
From what i can see is different architecture has different page table but Linux kernel has a generic code to support all architecture by having few common functionalities and also architecture dependent code.