]> git.baikalelectronics.ru Git - kernel.git/commitdiff
x86/build: Disable CET instrumentation in the kernel for 32-bit too
authorBorislav Petkov <bp@suse.de>
Mon, 8 Feb 2021 15:43:30 +0000 (16:43 +0100)
committerBorislav Petkov <bp@suse.de>
Tue, 9 Feb 2021 10:23:47 +0000 (11:23 +0100)
Commit

  001459ef05ec ("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: 001459ef05ec ("x86/build: Disable CET instrumentation in the kernel")
Reported-by: AC <achirvasub@gmail.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Acked-by: Josh Poimboeuf <jpoimboe@redhat.com>
Tested-by: AC <achirvasub@gmail.com>
Link: https://lkml.kernel.org/r/YCCIgMHkzh/xT4ex@arch-chirva.localdomain
arch/x86/Makefile

index 5857917f83eee9082bd09c2faa3aecd9e01537d5..30920d70b48b37e499cfddd93ad9fddede95218d 100644 (file)
@@ -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