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
Notes: sideshowbarker 2024-07-18 05:01:22 +09:00
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;

View File

@ -950,11 +950,6 @@ public:
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;
}
if (m_blocker && !m_blocker->can_be_interrupted() && !m_should_die) {
block_lock2.unlock();
dbgln("Thread should not be unblocking, current state: {}", state_string());