From 9853a9bc8acf6a287f764dc7798161499811c53a Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Thu, 11 Mar 2021 14:46:27 +0100 Subject: [PATCH] Kernel: Always protect process data immediately after construction --- Kernel/Process.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Kernel/Process.cpp b/Kernel/Process.cpp index 497025a9c2..e04bbde461 100644 --- a/Kernel/Process.cpp +++ b/Kernel/Process.cpp @@ -227,6 +227,9 @@ Process::Process(RefPtr& first_thread, const String& name, uid_t uid, gi , m_tty(tty) , m_wait_block_condition(*this) { + // Ensure that we protect the process data when exiting the constructor. + ProtectedDataMutationScope scope { *this }; + m_pid = allocate_pid(); m_ppid = ppid; m_uid = uid;