mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-22 21:32:31 +00:00
[metal] Allow more fine-grained control over page permissions (#663)
- use PAGE_RSRV bit (originally only for blinkenlights), rather than PAGE_V bit, to indicate that a virtual address page has been reserved — this should allow a program to create & reserve inaccessible "guard pages" - mark page table entries for non-code pages with PAGE_XD bit, which should be supported on (circa) post-2004 x86-64 CPUs
This commit is contained in:
parent
0f89140882
commit
d38700687a
5 changed files with 25 additions and 14 deletions
|
@ -126,7 +126,7 @@ __msabi noasan EFI_STATUS EfiMain(EFI_HANDLE ImageHandle,
|
|||
pdpt2 = (uint64_t *)0x7c000;
|
||||
pml4t = (uint64_t *)0x7e000;
|
||||
for (i = 0; i < 512; ++i) {
|
||||
pd[i] = 0x1000 * i + PAGE_V + PAGE_RW;
|
||||
pd[i] = 0x1000 * i + PAGE_V + PAGE_RSRV + PAGE_RW;
|
||||
}
|
||||
pdt1[0] = (intptr_t)pd + PAGE_V + PAGE_RW;
|
||||
pdt2[0] = (intptr_t)pd + PAGE_V + PAGE_RW;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue