Kernel: Preserve signal mask across fork(2) and execve(2)

A child created via fork(2) inherits a copy of its parent's signal
mask; the signal mask is preserved across execve(2).
This commit is contained in:
Idan Horowitz 2021-12-11 17:18:39 +02:00
commit 92a6c91f4e
Notes: sideshowbarker 2024-07-17 22:55:17 +09:00
3 changed files with 5 additions and 2 deletions

View file

@ -681,7 +681,7 @@ u32 Thread::signal_mask_block(sigset_t signal_set, bool block)
void Thread::clear_signals()
{
SpinlockLocker lock(g_scheduler_lock);
m_signal_mask = 0;
// The signal mask is preserved across execve(2).
m_pending_signals = 0;
m_have_any_unmasked_pending_signals.store(false, AK::memory_order_release);
m_signal_action_data.fill({});