Reputation: 55
The method mprotect
have a PROT_NONE option to disable memory access. It means "The memory cannot be accessed at all"
I wonder how it is implemented on x86/x64 platform.
According to the attributes R/W and XD of page table entry, a page can be set to read only and execution-disable. But how to implement PROT_NONE
mode so that the memory cannot be accessed at all?
In another words, how to produce a exception when memory is read.
Is limited by my ability, I can't find the implementation mechanism through source code. It seems like only modify the protection flags of page table entry.
Upvotes: 1
Views: 746