Skip to content

Commit 99b863d

Browse files
ardbiesheuvelbp3tk0v
authored andcommitted
x86/sev: Disable UBSAN on SEV code that may execute very early
Clang 14 and older may emit UBSAN instrumentation into code that is inlined into functions marked with __no_sanitize_undefined¹. This may result in faults when the code is executed very early, which may be the case for functions annotated as __head. Now that this requirement is strictly enforced, the build will fail in this case with the following message Absolute reference to symbol '.data' not permitted in .head.text Work around this by disabling UBSAN instrumentation on all SEV core code. ¹ https://lore.kernel.org/r/20250101024348.GA1828419@ax162 [ bp: Add a footnote with Nathan's detailed explanation and a Fixes tag ] Fixes: 3b6f99a ("x86/boot: Disable UBSAN in early boot code") Signed-off-by: Ard Biesheuvel <[email protected]> Signed-off-by: Borislav Petkov (AMD) <[email protected]> Reviewed-by: Nathan Chancellor <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 35aafa1 commit 99b863d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

arch/x86/coco/sev/Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,6 @@ KCOV_INSTRUMENT_core.o := n
1313
# With some compiler versions the generated code results in boot hangs, caused
1414
# by several compilation units. To be safe, disable all instrumentation.
1515
KCSAN_SANITIZE := n
16+
17+
# Clang 14 and older may fail to respect __no_sanitize_undefined when inlining
18+
UBSAN_SANITIZE := n

0 commit comments

Comments
 (0)