Skip to content

Commit 256b92a

Browse files
committed
x86/build: Disable CET instrumentation in the kernel for 32-bit too
Commit 20bf2b3 ("x86/build: Disable CET instrumentation in the kernel") disabled CET instrumentation which gets added by default by the Ubuntu gcc9 and 10 by default, but did that only for 64-bit builds. It would still fail when building a 32-bit target. So disable CET for all x86 builds. Fixes: 20bf2b3 ("x86/build: Disable CET instrumentation in the kernel") Reported-by: AC <[email protected]> Signed-off-by: Borislav Petkov <[email protected]> Acked-by: Josh Poimboeuf <[email protected]> Tested-by: AC <[email protected]> Link: https://lkml.kernel.org/r/YCCIgMHkzh/[email protected]
1 parent 2ade0d6 commit 256b92a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

arch/x86/Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ export BITS
5050
KBUILD_CFLAGS += -mno-sse -mno-mmx -mno-sse2 -mno-3dnow
5151
KBUILD_CFLAGS += $(call cc-option,-mno-avx,)
5252

53+
# Intel CET isn't enabled in the kernel
54+
KBUILD_CFLAGS += $(call cc-option,-fcf-protection=none)
55+
5356
ifeq ($(CONFIG_X86_32),y)
5457
BITS := 32
5558
UTS_MACHINE := i386
@@ -120,9 +123,6 @@ else
120123

121124
KBUILD_CFLAGS += -mno-red-zone
122125
KBUILD_CFLAGS += -mcmodel=kernel
123-
124-
# Intel CET isn't enabled in the kernel
125-
KBUILD_CFLAGS += $(call cc-option,-fcf-protection=none)
126126
endif
127127

128128
ifdef CONFIG_X86_X32

0 commit comments

Comments
 (0)