Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

where is the executable bit in page table entry?

enter image description here

this is a figure from Intel architecture manual. in x86 32bit page table entry, where is the bit which indicates if the page is executable or not?

if it's not here, how can a OS set memory permission for exec? with something like mmap function?

like image 496
daehee Avatar asked Mar 24 '26 00:03

daehee


1 Answers

AFAIK, a page is executable if it's readable, so they all executable. But, what you might thinking here is that, there are pages which has nonexec bit set. Well, that's a software hack, done from kernel. This technique was introduced to avoid stackoverflow based attack, by making a particular page (vm area) non-executable.

like image 53
rakib_ Avatar answered Mar 26 '26 13:03

rakib_