Skip to content

Commit c0935fc

Browse files
Changbin Dubp3tk0v
authored andcommitted
x86/sev: Disable KMSAN for memory encryption TUs
Instrumenting sev.c and mem_encrypt_identity.c with KMSAN will result in a triple-faulting kernel. Some of the code is invoked too early during boot, before KMSAN is ready. Disable KMSAN instrumentation for the two translation units. [ bp: Massage commit message. ] Signed-off-by: Changbin Du <changbin.du@huawei.com> Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de> Link: https://lore.kernel.org/r/20240308044401.1120395-1-changbin.du@huawei.com
1 parent d7b69b5 commit c0935fc

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

arch/x86/kernel/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ KASAN_SANITIZE_sev.o := n
3333
KCSAN_SANITIZE := n
3434
KMSAN_SANITIZE_head$(BITS).o := n
3535
KMSAN_SANITIZE_nmi.o := n
36+
KMSAN_SANITIZE_sev.o := n
3637

3738
# If instrumentation of the following files is enabled, boot hangs during
3839
# first second.

arch/x86/mm/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ KASAN_SANITIZE_pgprot.o := n
1616
KCSAN_SANITIZE := n
1717
# Avoid recursion by not calling KMSAN hooks for CEA code.
1818
KMSAN_SANITIZE_cpu_entry_area.o := n
19+
KMSAN_SANITIZE_mem_encrypt_identity.o := n
1920

2021
ifdef CONFIG_FUNCTION_TRACER
2122
CFLAGS_REMOVE_mem_encrypt.o = -pg

0 commit comments

Comments
 (0)