diff options
author | Andreas Kling <kling@serenityos.org> | 2021-03-11 14:24:08 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-03-11 14:24:08 +0100 |
commit | 1608ef37d8a945c9422cc3dc40b1e04842dcf60b (patch) | |
tree | 9caf52c3cb65defdfb9a1eb550c8eda9274ab3ca /Kernel/Process.cpp | |
parent | 4916b5c1300573c4fca94a1c0caf3a757565add4 (diff) | |
download | serenity-1608ef37d8a945c9422cc3dc40b1e04842dcf60b.zip |
Kernel: Move process termination status/signal into protected data
Diffstat (limited to 'Kernel/Process.cpp')
-rw-r--r-- | Kernel/Process.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/Kernel/Process.cpp b/Kernel/Process.cpp index 3d74cf4dee..497025a9c2 100644 --- a/Kernel/Process.cpp +++ b/Kernel/Process.cpp @@ -334,7 +334,10 @@ void Process::crash(int signal, u32 eip, bool out_of_memory) } dump_backtrace(); } - m_termination_signal = signal; + { + ProtectedDataMutationScope scope { *this }; + m_termination_signal = signal; + } set_dump_core(!out_of_memory); space().dump_regions(); VERIFY(is_user_process()); @@ -578,8 +581,11 @@ void Process::terminate_due_to_signal(u8 signal) VERIFY(signal < 32); VERIFY(Process::current() == this); dbgln("Terminating {} due to signal {}", *this, signal); - m_termination_status = 0; - m_termination_signal = signal; + { + ProtectedDataMutationScope scope { *this }; + m_termination_status = 0; + m_termination_signal = signal; + } die(); } |