mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-12-11 17:00:37 +00:00
Hang if we GPF in ring 0.
This commit is contained in:
parent
56c1f9db8e
commit
1a801e5737
Notes:
sideshowbarker
2024-07-19 18:46:38 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/1a801e5737f
2 changed files with 7 additions and 0 deletions
|
@ -37,6 +37,8 @@ public:
|
|||
Ring3 = 3,
|
||||
};
|
||||
|
||||
bool isRing0() const { return m_ring == Ring0; }
|
||||
|
||||
static Task* fromPID(pid_t);
|
||||
static Task* fromIPCHandle(IPC::Handle);
|
||||
static Task* kernelTask();
|
||||
|
|
|
@ -79,6 +79,11 @@ void exception_13_handler()
|
|||
kprintf("eax=%x ebx=%x ecx=%x edx=%x\n", regs.eax, regs.ebx, regs.ecx, regs.edx);
|
||||
kprintf("ebp=%x esp=%x esi=%x edi=%x\n", regs.ebp, regs.esp, regs.esi, regs.edi);
|
||||
|
||||
if (current->isRing0()) {
|
||||
kprintf("Oh shit, we've crashed in ring 0 :(\n");
|
||||
HANG;
|
||||
}
|
||||
|
||||
current->setState(Task::Crashing);
|
||||
if (!scheduleNewTask()) {
|
||||
kprintf("Failed to schedule a new task :(\n");
|
||||
|
|
Loading…
Reference in a new issue