mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-30 08:41:15 +00:00
Kernel: VERIFY that signals are not sent to Kernel processes
Kernel processes can't handle signals, nor should they ever receive any
This commit is contained in:
parent
2c996cbbee
commit
0911112286
Notes:
sideshowbarker
2024-07-17 18:25:23 +09:00
Author: https://github.com/IdanHo Commit: https://github.com/SerenityOS/serenity/commit/0911112286 Pull-request: https://github.com/SerenityOS/serenity/pull/12704 Issue: https://github.com/SerenityOS/serenity/issues/9837
|
@ -707,6 +707,7 @@ void Process::terminate_due_to_signal(u8 signal)
|
|||
|
||||
ErrorOr<void> Process::send_signal(u8 signal, Process* sender)
|
||||
{
|
||||
VERIFY(is_user_process());
|
||||
// Try to send it to the "obvious" main thread:
|
||||
auto receiver_thread = Thread::from_tid(pid().value());
|
||||
// If the main thread has died, there may still be other threads:
|
||||
|
|
|
@ -721,6 +721,7 @@ u32 Thread::pending_signals_for_state() const
|
|||
void Thread::send_signal(u8 signal, [[maybe_unused]] Process* sender)
|
||||
{
|
||||
VERIFY(signal < 32);
|
||||
VERIFY(process().is_user_process());
|
||||
SpinlockLocker scheduler_lock(g_scheduler_lock);
|
||||
|
||||
// FIXME: Figure out what to do for masked signals. Should we also ignore them here?
|
||||
|
|
Loading…
Reference in a new issue