Skip to contentSkip to conversation

UBSAN: Use the kernel panic message markers

PATCH Applied Borislav Petkov 1 participant 1 message Dec 18, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 UBSAN: Use the kernel panic message markers

From: "Borislav Petkov (AMD)" <[email protected]>

Use the same splat markers as panic does for easier matching by external tools scanning kernel dmesg for splats.

Cc Andrey Ryabinin <[email protected]>
Cc Andrew Morton <[email protected]>
---
 lib/ubsan.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
lib/ubsan.c +3 -4
index 3f90810f9f42..df4f8d1354bb 100644
@@ -204,8 +204,8 @@ static void ubsan_prologue(struct source_location *loc, const char *reason)
 {
 	current->in_ubsan++;
 
-	pr_err("========================================"
-		"========================================\n");
+	pr_warn(CUT_HERE);
+
 	pr_err("UBSAN: %s in %s:%d:%d\n", reason, loc->file_name,
 		loc->line & LINE_MASK, loc->column & COLUMN_MASK);
 
@@ -215,8 +215,7 @@ static void ubsan_prologue(struct source_location *loc, const char *reason)
 static void ubsan_epilogue(void)
 {
 	dump_stack();
-	pr_err("========================================"
-		"========================================\n");
+	pr_warn("---[ end trace ]---\n");
 
 	current->in_ubsan--;
 
Signature · 1 line
2.42.0.rc0.25.ga82fb66fed25