1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 06:38:10 +00:00

Kernel: Don't honor userspace SIGSTOP requests in Thread::block()

Instead, wait until we transition back to userspace. This stops
userspace from being able to suspend a thread indefinitely while it's
running in kernelspace (potentially holding some blocking mutex.)
This commit is contained in:
Andreas Kling 2021-12-21 22:16:33 +01:00
parent cf7bbcc70e
commit 601a9321d9
2 changed files with 0 additions and 11 deletions

View file

@ -208,12 +208,6 @@ void Thread::block(Kernel::Mutex& lock, SpinlockLocker<Spinlock>& lock_lock, u32
VERIFY(Processor::in_critical());
SpinlockLocker block_lock2(m_block_lock);
if (should_be_stopped() || state() == Stopped) {
dbgln("Thread should be stopped, current state: {}", state_string());
set_state(Thread::Blocked);
continue;
}
VERIFY(!m_blocking_lock);
m_blocking_lock = previous_blocking_lock;
break;