diff options
| author | Ard Biesheuvel <ardb@kernel.org> | 2024-12-05 12:28:09 +0100 |
|---|---|---|
| committer | Ingo Molnar <mingo@kernel.org> | 2024-12-05 13:18:54 +0100 |
| commit | 3b6f99a94b04b389292590840d96342b7dd08941 (patch) | |
| tree | 31e17a3ffa6f2f3a1fa3acee44a16ed15de94b87 /arch/x86/include/asm/init.h | |
| parent | 0d9b9a328cb605419ed046d341dc2a3d66ee0256 (diff) | |
| download | linux-next-3b6f99a94b04b389292590840d96342b7dd08941.tar.gz linux-next-3b6f99a94b04b389292590840d96342b7dd08941.zip | |
x86/boot: Disable UBSAN in early boot code
The early boot code runs from a 1:1 mapping of memory, and may execute
before the kernel virtual mapping is even up. This means absolute symbol
references cannot be permitted in this code.
UBSAN injects references to global data structures into the code, and
without -fPIC, those references are emitted as absolute references to
kernel virtual addresses. Accessing those will fault before the kernel
virtual mapping is up, so UBSAN needs to be disabled in early boot code.
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Link: https://lore.kernel.org/r/20241205112804.3416920-13-ardb+git@google.com
Diffstat (limited to 'arch/x86/include/asm/init.h')
| -rw-r--r-- | arch/x86/include/asm/init.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/x86/include/asm/init.h b/arch/x86/include/asm/init.h index 14d72727d7ee..0e82ebc5d1e1 100644 --- a/arch/x86/include/asm/init.h +++ b/arch/x86/include/asm/init.h @@ -2,7 +2,7 @@ #ifndef _ASM_X86_INIT_H #define _ASM_X86_INIT_H -#define __head __section(".head.text") +#define __head __section(".head.text") __no_sanitize_undefined struct x86_mapping_info { void *(*alloc_pgt_page)(void *); /* allocate buf for page table */ |
