[metal] Fix bug: munmap() should clear PAGE_RSRV in page table

This commit is contained in:
tkchia 2022-10-14 08:45:29 +00:00
parent da336b3ea8
commit 28bd57c6d0

View file

@ -26,7 +26,7 @@ noasan int sys_munmap_metal(void *addr, size_t size) {
mm = (struct mman *)(BANE + 0x0500);
for (i = 0; i < size; i += 4096) {
e = __get_virtual(mm, __get_pml4t(), (uint64_t)addr + i, false);
if (e) *e = ~PAGE_V;
if (e) *e = ~(PAGE_V | PAGE_RSRV);
invlpg(e);
}
return 0;