linux-stable/arch/x86
Josh Poimboeuf bc1a3aeeff x86/build: Disable CET instrumentation in the kernel
commit 20bf2b3787 upstream.

With retpolines disabled, some configurations of GCC, and specifically
the GCC versions 9 and 10 in Ubuntu will add Intel CET instrumentation
to the kernel by default. That breaks certain tracing scenarios by
adding a superfluous ENDBR64 instruction before the fentry call, for
functions which can be called indirectly.

CET instrumentation isn't currently necessary in the kernel, as CET is
only supported in user space. Disable it unconditionally and move it
into the x86's Makefile as CET/CFI... enablement should be a per-arch
decision anyway.

 [ bp: Massage and extend commit message. ]

Fixes: 29be86d7f9 ("kbuild: add -fcf-protection=none when using retpoline flags")
Reported-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
Signed-off-by: Borislav Petkov <bp@suse.de>
Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Tested-by: Nikolay Borisov <nborisov@suse.com>
Cc: <stable@vger.kernel.org>
Cc: Seth Forshee <seth.forshee@canonical.com>
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Link: https://lkml.kernel.org/r/20210128215219.6kct3h2eiustncws@treble
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-02-10 09:25:32 +01:00
..
boot x86/asm: Replace __force_order with a memory clobber 2020-10-29 09:58:01 +01:00
configs vgacon: remove software scrollback support 2020-09-17 13:47:54 +02:00
crypto crypto: x86/crc32c - fix building with clang ias 2020-11-01 12:01:06 +01:00
entry x86/asm/32: Add ENDs to some functions and relabel with SYM_CODE_* 2021-01-17 14:05:30 +01:00
events perf/x86/intel: Fix rtm_abort_event encoding on Ice Lake 2020-12-30 11:51:35 +01:00
hyperv x86/hyperv: check cpu mask after interrupt has been disabled 2021-01-19 18:26:12 +01:00
ia32
include x86: __always_inline __{rd,wr}msr() 2021-02-07 15:35:48 +01:00
kernel x86/cpu/amd: Set __max_die_per_package on AMD 2021-01-27 11:47:52 +01:00
kvm KVM: x86: Update emulator context mode if SYSENTER xfers to 64-bit mode 2021-02-10 09:25:31 +01:00
lib x86/mmx: Use KFPU_387 for MMX string operations 2021-01-27 11:47:49 +01:00
math-emu x86: math-emu: Fix up 'cmp' insn for clang ias 2020-07-29 10:18:40 +02:00
mm KVM: SVM: Treat SVM as unsupported when running as an SEV guest 2021-02-10 09:25:31 +01:00
net
oprofile
pci x86/PCI: Fix intel_mid_pci.c build error when ACPI is not enabled 2020-11-01 12:01:02 +01:00
platform efi/x86: Free efi_pgd with free_pages() 2020-11-24 13:29:19 +01:00
power x86/asm/32: Add ENDs to some functions and relabel with SYM_CODE_* 2021-01-17 14:05:30 +01:00
purgatory x86/purgatory: Disable various profiling and sanitizing options 2020-06-24 17:50:20 +02:00
ras
realmode x86/asm/32: Add ENDs to some functions and relabel with SYM_CODE_* 2021-01-17 14:05:30 +01:00
tools
um
video
xen x86/xen: Add xen_no_vector_callback option to test PCI INTX delivery 2021-01-27 11:47:45 +01:00
.gitignore
Kbuild
Kconfig
Kconfig.cpu
Kconfig.debug
Makefile x86/build: Disable CET instrumentation in the kernel 2021-02-10 09:25:32 +01:00
Makefile.um
Makefile_32.cpu