summaryrefslogtreecommitdiff
path: root/Kernel/UBSanitizer.cpp
diff options
context:
space:
mode:
authorBrian Gianforcaro <bgianf@serenityos.org>2021-05-14 22:51:09 -0700
committerAndreas Kling <kling@serenityos.org>2021-05-15 09:00:29 +0200
commitf982ef0ef09401ce729e7c25272eebc95b6f0651 (patch)
treedd887ec27558ed7ccbc24ae7cc331585d787d643 /Kernel/UBSanitizer.cpp
parentdb78331741d1150fd38c35d06722b60928039aea (diff)
downloadserenity-f982ef0ef09401ce729e7c25272eebc95b6f0651.zip
Kernel: Halt CPU on deadly UBSAN instead of calling PANIC
The separate backtrace that the PANIC emits isn't useful and just adds more data to visually filter from the output when debugging an issue. Instead of calling PANIC, just emit the message with dbgln() and manually halt the system.
Diffstat (limited to 'Kernel/UBSanitizer.cpp')
-rw-r--r--Kernel/UBSanitizer.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/Kernel/UBSanitizer.cpp b/Kernel/UBSanitizer.cpp
index c30f58436e..37873c4a41 100644
--- a/Kernel/UBSanitizer.cpp
+++ b/Kernel/UBSanitizer.cpp
@@ -5,8 +5,8 @@
*/
#include <AK/Format.h>
+#include <Kernel/Arch/x86/CPU.h>
#include <Kernel/KSyms.h>
-#include <Kernel/Panic.h>
#include <Kernel/UBSanitizer.h>
using namespace Kernel;
@@ -24,8 +24,10 @@ static void print_location(const SourceLocation& location)
dbgln("KUBSAN: at {}, line {}, column: {}", location.filename(), location.line(), location.column());
}
dump_backtrace();
- if (g_ubsan_is_deadly)
- PANIC("UB is configured to be deadly.");
+ if (g_ubsan_is_deadly) {
+ dbgln("UB is configured to be deadly, halting the system.");
+ Processor::halt();
+ }
}
void __ubsan_handle_load_invalid_value(const InvalidValueData&, ValueHandle) __attribute__((used));