1
linux/arch/x86
Sabyrzhan Tasbolatov 1db272864f x86/traps: move kmsan check after instrumentation_begin
During x86_64 kernel build with CONFIG_KMSAN, the objtool warns following:

  AR      built-in.a
  AR      vmlinux.a
  LD      vmlinux.o
vmlinux.o: warning: objtool: handle_bug+0x4: call to
    kmsan_unpoison_entry_regs() leaves .noinstr.text section
  OBJCOPY modules.builtin.modinfo
  GEN     modules.builtin
  MODPOST Module.symvers
  CC      .vmlinux.export.o

Moving kmsan_unpoison_entry_regs() _after_ instrumentation_begin() fixes
the warning.

There is decode_bug(regs->ip, &imm) is left before KMSAN unpoisoining, but
it has the return condition and if we include it after
instrumentation_begin() it results the warning "return with
instrumentation enabled", hence, I'm concerned that regs will not be KMSAN
unpoisoned if `ud_type == BUG_NONE` is true.

Link: https://lkml.kernel.org/r/20241016152407.3149001-1-snovitoll@gmail.com
Fixes: ba54d194f8 ("x86/traps: avoid KMSAN bugs originating from handle_bug()")
Signed-off-by: Sabyrzhan Tasbolatov <snovitoll@gmail.com>
Reviewed-by: Alexander Potapenko <glider@google.com>
Cc: Borislav Petkov (AMD) <bp@alien8.de>
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2024-10-28 21:40:39 -07:00
..
boot
coco x86/tdx: Fix "in-kernel MMIO" check 2024-09-26 09:45:04 -07:00
configs
crypto move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
entry - Explicitly disable the TSC deadline timer when going idle to address 2024-10-20 12:04:32 -07:00
events Performance events changes for v6.12: 2024-09-18 15:03:58 +02:00
hyperv hyperv-next for v6.12 2024-09-19 08:15:30 +02:00
ia32
include x86: fix whitespace in runtime-const assembler output 2024-10-25 09:53:03 -07:00
kernel x86/traps: move kmsan check after instrumentation_begin 2024-10-28 21:40:39 -07:00
kvm KVM: nSVM: Ignore nCR3[4:0] when loading PDPTEs from memory 2024-10-20 07:31:06 -04:00
lib x86: fix user address masking non-canonical speculation issue 2024-10-25 09:53:03 -07:00
math-emu
mm x86: 2024-09-28 09:20:14 -07:00
net
pci
platform xen: branch for v6.12-rc1a 2024-09-27 09:55:30 -07:00
power
purgatory
ras
realmode
tools
um This pull request contains the following changes for UML: 2024-09-27 12:48:48 -07:00
video
virt x86/sev: Ensure that RMP table fixups are reserved 2024-10-23 12:34:06 +02:00
xen x86/xen: mark boot CPU of PV guest in MSR_IA32_APICBASE 2024-10-08 16:18:57 +02:00
.gitignore
Kbuild
Kconfig x86/lam: Disable ADDRESS_MASKING in most cases 2024-10-21 15:05:43 -07:00
Kconfig.assembler
Kconfig.cpu
Kconfig.debug
Makefile rust: cfi: add support for CFI_CLANG with Rust 2024-09-16 17:29:58 +02:00
Makefile_32.cpu
Makefile.postlink
Makefile.um