title: How are memory read, write, execute permissions enforced in the Linux kernel?
body: <p>How is a system able to restrict processes from being able to write to regions of memory set read-only? In particular, how is the Linux kernel able to enforce these permissions, assuming that the hardware is <strong>not</strong> able to do this job for the kernel?</p>
  
  <p>My initial guess is that these regions of memory are not mapped to the process's address space, so whenever the process tries accessing these regions of memory, a page fault is generated, which allows the kernel to take control to check that everything is in order. I realize this would probably greatly degrade performance, so I'm here asking for help understanding if there is a smarter method to enforcing these permissions.</p>