diff options
author | Andreas Kling <awesomekling@gmail.com> | 2018-11-28 20:59:10 +0100 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2018-11-28 20:59:10 +0100 |
commit | 938d1b8bfb2d05911ebf0f06b9d8e19a15f50630 (patch) | |
tree | f7ff076d771a9b1100f91377a51b428b5e62f663 /Kernel/Process.cpp | |
parent | 629c5be10b00dd4d8e5675018e9282b84a9586e3 (diff) | |
download | serenity-938d1b8bfb2d05911ebf0f06b9d8e19a15f50630.zip |
Drop any old signal stacks on exec().
Diffstat (limited to 'Kernel/Process.cpp')
-rw-r--r-- | Kernel/Process.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/Kernel/Process.cpp b/Kernel/Process.cpp index 34758bf2e8..30c8a40ad5 100644 --- a/Kernel/Process.cpp +++ b/Kernel/Process.cpp @@ -353,8 +353,11 @@ int Process::do_exec(const String& path, Vector<String>&& arguments, Vector<Stri } } + m_signal_stack_kernel_region = nullptr; + m_signal_stack_user_region = nullptr; memset(m_signal_action_data, 0, sizeof(m_signal_action_data)); m_signal_mask = 0xffffffff; + m_pending_signals = 0; for (size_t i = 0; i < m_fds.size(); ++i) { auto& daf = m_fds[i]; @@ -387,7 +390,7 @@ int Process::do_exec(const String& path, Vector<String>&& arguments, Vector<Stri m_tss.cr3 = (dword)m_page_directory; m_stack_region = allocate_region(LinearAddress(), defaultStackSize, "stack"); ASSERT(m_stack_region); - m_stackTop3 = m_stack_region->linearAddress.offset(defaultStackSize).get() & 0xfffffff8; + m_stackTop3 = m_stack_region->linearAddress.offset(defaultStackSize).get(); m_tss.esp = m_stackTop3; m_tss.ss0 = 0x10; m_tss.esp0 = old_esp0; @@ -660,7 +663,7 @@ Process::Process(String&& name, uid_t uid, gid_t gid, pid_t ppid, RingLevel ring } else { auto* region = allocate_region(LinearAddress(), defaultStackSize, "stack"); ASSERT(region); - m_stackTop3 = region->linearAddress.offset(defaultStackSize).get() & 0xfffffff8; + m_stackTop3 = region->linearAddress.offset(defaultStackSize).get(); m_tss.esp = m_stackTop3; } } |