mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 08:47:34 +00:00
Kernel: Don't try to dispatch urgent signals for kernel crashes
If we crashed in the kernel there's no point to sending a signal to the active process, we're going to panic soon anyway.
This commit is contained in:
parent
548488f050
commit
39ecb832e4
1 changed files with 3 additions and 3 deletions
|
@ -219,7 +219,8 @@ void handle_crash(RegisterState const& regs, char const* description, int signal
|
||||||
if (!current_thread)
|
if (!current_thread)
|
||||||
PANIC("{} with !Thread::current()", description);
|
PANIC("{} with !Thread::current()", description);
|
||||||
|
|
||||||
if (!current_thread->should_ignore_signal(signal) && !current_thread->is_signal_masked(signal)) {
|
auto crashed_in_kernel = (regs.cs & 3) == 0;
|
||||||
|
if (!crashed_in_kernel && !current_thread->should_ignore_signal(signal) && !current_thread->is_signal_masked(signal)) {
|
||||||
current_thread->send_urgent_signal_to_self(signal);
|
current_thread->send_urgent_signal_to_self(signal);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -233,9 +234,8 @@ void handle_crash(RegisterState const& regs, char const* description, int signal
|
||||||
dmesgln("CRASH: CPU #{} {} in ring {}", Processor::current_id(), description, (regs.cs & 3));
|
dmesgln("CRASH: CPU #{} {} in ring {}", Processor::current_id(), description, (regs.cs & 3));
|
||||||
dump(regs);
|
dump(regs);
|
||||||
|
|
||||||
if (!(regs.cs & 3)) {
|
if (crashed_in_kernel)
|
||||||
PANIC("Crash in ring 0");
|
PANIC("Crash in ring 0");
|
||||||
}
|
|
||||||
|
|
||||||
process.crash(signal, regs.ip(), out_of_memory);
|
process.crash(signal, regs.ip(), out_of_memory);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue