1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 04:58:13 +00:00

Kernel: Forked children should inherit their RangeAllocator by copy.

Otherwise we'll start handing out addresses that are very likely already in
use by existing ranges.
This commit is contained in:
Andreas Kling 2019-05-22 13:24:28 +02:00
parent 8098d2e337
commit 7afc0fb9c8
5 changed files with 11 additions and 5 deletions

View file

@ -557,7 +557,7 @@ Process::Process(String&& name, uid_t uid, gid_t gid, pid_t ppid, RingLevel ring
{
dbgprintf("Process: New process PID=%u with name=%s\n", m_pid, m_name.characters());
m_page_directory = PageDirectory::create_for_userspace();
m_page_directory = PageDirectory::create_for_userspace(fork_parent ? &fork_parent->page_directory().range_allocator() : nullptr);
#ifdef MM_DEBUG
dbgprintf("Process %u ctor: PD=%x created\n", pid(), m_page_directory.ptr());
#endif