Skip to contentSkip to conversation

x86/build: Disable CET instrumentation in the kernel for 32-bit too

tip: x86/urgent tip-bot2 for Borislav Petkov 1 participant 1 message Feb 9, 2021 1 message not in the archive x86

lore
Share & tools
lore

tip-bot2 for Borislav Petkov

author merge bot Applied
#1 lore raw
In reply to a message not in the archive

The following commit has been merged into the x86/urgent branch of tip:

Commit-ID:     256b92af784d5043eeb7d559b6d5963dcc2ecb10
Gitweb:        https://git.kernel.org/tip/256b92af784d5043eeb7d559b6d5963dcc2ecb10
Author:        Borislav Petkov <[email protected]>
AuthorDate:    Mon, 08 Feb 2021 16:43:30 +01:00
Committer:     Borislav Petkov <[email protected]>
CommitterDate: Tue, 09 Feb 2021 11:23:47 +01:00

x86/build: Disable CET instrumentation in the kernel for 32-bit too

Commit

20bf2b378729 ("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 20bf2b378729 ("x86/build: Disable CET instrumentation in the kernel")
---
 arch/x86/Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
arch/x86/Makefile +3 -3
index 5857917..30920d7 100644
@@ -50,6 +50,9 @@ export BITS
 KBUILD_CFLAGS += -mno-sse -mno-mmx -mno-sse2 -mno-3dnow
 KBUILD_CFLAGS += $(call cc-option,-mno-avx,)
 
+# Intel CET isn't enabled in the kernel
+KBUILD_CFLAGS += $(call cc-option,-fcf-protection=none)
+
 ifeq ($(CONFIG_X86_32),y)
         BITS := 32
         UTS_MACHINE := i386
@@ -120,9 +123,6 @@ else
 
         KBUILD_CFLAGS += -mno-red-zone
         KBUILD_CFLAGS += -mcmodel=kernel
-
-	# Intel CET isn't enabled in the kernel
-	KBUILD_CFLAGS += $(call cc-option,-fcf-protection=none)
 endif
 
 ifdef CONFIG_X86_X32