forked from torvalds/linux
-
Notifications
You must be signed in to change notification settings - Fork 15
Closed
Labels
[ARCH] x86_64This bug impacts ARCH=x86_64This bug impacts ARCH=x86_64[BUG] linux-nextThis is an issue only seen in linux-nextThis is an issue only seen in linux-next[FEATURE] CFIRelated to building the kernel with Clang Control Flow IntegrityRelated to building the kernel with Clang Control Flow Integrity[FIXED][LINUX] 5.13This bug was fixed in Linux 5.13This bug was fixed in Linux 5.13
Description
My commit 0024430e920f
("x86/build: Fix location of '-plugin-opt=' flags") prevents my WSL2 virtual machine from booting on my Intel based laptop, even though my AMD based workstation has no issues with the exact same binary.
So far, I have verified that:
- The issue is not present with just
CONFIG_LTO_CLANG_THIN
, only withCONFIG_LTO_CLANG_THIN
+CONFIG_CFI_CLANG
(regardless ofCONFIG_CFI_PERMISSIVE
). - The issue is not present with
CONFIG_CFI_CLANG
and the following diff:
diff --git a/arch/x86/Makefile b/arch/x86/Makefile
index 307529417021..3ecc786f8144 100644
--- a/arch/x86/Makefile
+++ b/arch/x86/Makefile
@@ -200,8 +200,7 @@ endif
KBUILD_LDFLAGS += -m elf_$(UTS_MACHINE)
ifdef CONFIG_LTO_CLANG
-KBUILD_LDFLAGS += -plugin-opt=-code-model=kernel \
- -plugin-opt=-stack-alignment=$(if $(CONFIG_X86_32),4,8)
+KBUILD_LDFLAGS += -plugin-opt=-code-model=kernel
endif
ifdef CONFIG_X86_NEED_RELOCS
Unfortunately, getting kernel logs from WSL2 seems impossible but I will continue to research that. QEMU within WSL2 does not reproduce the issue. I will see if I can reproduce in some other way. This does not appear to LLVM version dependent because I can reproduce at LLVM 12.0.0 but I can try earlier versions to see.
Metadata
Metadata
Assignees
Labels
[ARCH] x86_64This bug impacts ARCH=x86_64This bug impacts ARCH=x86_64[BUG] linux-nextThis is an issue only seen in linux-nextThis is an issue only seen in linux-next[FEATURE] CFIRelated to building the kernel with Clang Control Flow IntegrityRelated to building the kernel with Clang Control Flow Integrity[FIXED][LINUX] 5.13This bug was fixed in Linux 5.13This bug was fixed in Linux 5.13