From 7710e48d838e6cc002fb4ee23f0c794fdc6b952d Mon Sep 17 00:00:00 2001 From: Sergey Bugaev Date: Fri, 14 Jun 2019 14:50:40 +0300 Subject: [PATCH] VM: Fix freeing physical pages. Pages created with PhysicalPage::create_eternal() should *not* be returnable to the freelist; and pages created with the regular PhysicalPage::create() should be; not the other way around. --- Kernel/VM/PhysicalPage.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Kernel/VM/PhysicalPage.cpp b/Kernel/VM/PhysicalPage.cpp index f6027589a7..43d014a0c8 100644 --- a/Kernel/VM/PhysicalPage.cpp +++ b/Kernel/VM/PhysicalPage.cpp @@ -5,14 +5,14 @@ Retained PhysicalPage::create_eternal(PhysicalAddress paddr, bool supervisor) { void* slot = kmalloc_eternal(sizeof(PhysicalPage)); - new (slot) PhysicalPage(paddr, supervisor); + new (slot) PhysicalPage(paddr, supervisor, false); return adopt(*(PhysicalPage*)slot); } Retained PhysicalPage::create(PhysicalAddress paddr, bool supervisor) { void* slot = kmalloc(sizeof(PhysicalPage)); - new (slot) PhysicalPage(paddr, supervisor, false); + new (slot) PhysicalPage(paddr, supervisor); return adopt(*(PhysicalPage*)slot); }