If a virtual memory page is executable, does it imply that it is readable?

590 views Asked by At

If I created a virtual memory page on a x86 system with the page protection set to only executable, would it imply that the page is also readable?

2

There are 2 answers

0
Hans Passant On BEST ANSWER

Assuming IA-32e mode: yes, a page table entry has no bit that inhibits reading, only writing (bit 1, R/W). Pages are always readable, assuming bit 2 (U/S, User/Supervisory) allows access. Bit 63, EXB is the Execute Inhibit bit. That's it for protection flags. Chapter 3.10.3 in the Intel processor manual.

1
Adrian Ratnapala On

I think the x86 doesn't have a seperate executable flag, all readable pages are executable. So I guess that means the answer is "yes" (even if the logic is backwards).