Question #102: Why do we need access control bits in page table entries?
- Because the pages might be shared.
- Some pages might contain executable code, which is read-only.
- Some pages contain data, so there shouldn’t be any instructions that should execute from that memory space.
Options:
A. All of the options 1, 2 and 3 are correct.
B. Only option 1 is correct.
C. Only options 2 and 3 are correct.
D. Only options 1 and 2 are correct.
Solution: The correct answer is C. Executable code should only be read-only and any attempt to write on that space should be trapped. Similarly any data should be read or written, but any attempt to execute from that address space should be trapped!