Introduce the CONFIG_UBSAN_FATAL option to cater to scenarios where prompt
attention to undefined behavior issues, notably during CI test runs, is
essential. When enabled, this option causes Xen to panic upon detecting
UBSAN failure (as the last step in ubsan_epilogue()).
Signed-off-by: Michal Orzel <michal.orzel@amd.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
If unsure, say N here.
+config UBSAN_FATAL
+ bool "Panic on UBSAN failure"
+ depends on UBSAN
+ help
+ Enabling this option will cause Xen to panic when an undefined behavior
+ is detected by UBSAN. If unsure, say N here.
+
config DEBUG_TRACE
bool "Debug trace support"
---help---
"========================================\n");
spin_unlock_irqrestore(&report_lock, *flags);
current->in_ubsan--;
+
+ if (IS_ENABLED(CONFIG_UBSAN_FATAL))
+ panic("UBSAN failure detected\n");
}
static void handle_overflow(struct overflow_data *data, unsigned long lhs,