linux/arch
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
..
alpha move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
arc move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
arm This pull request contains Broadcom ARM-based SoCs Device Tree fixes for 2024-10-11 10:03:30 +00:00
arm64 BPF fixes: 2024-10-24 16:53:20 -07:00
csky mm: make arch_get_unmapped_area() take vm_flags by default 2024-09-09 16:39:13 -07:00
hexagon hexagon: vdso: Fix build failure 2024-09-23 08:17:50 -07:00
loongarch LoongArch: KVM: Mark hrtimer to expire in hard interrupt context 2024-10-23 22:15:44 +08:00
m68k m68knommu: updates and fixes for v6.12 2024-09-24 10:48:44 -07:00
microblaze move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
mips move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
nios2 move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
openrisc
parisc move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
powerpc powerpc/powernv: Free name on error in opal_event_init() 2024-10-16 09:26:50 +11:00
riscv ARM64: 2024-10-21 11:22:04 -07:00
s390 s390 fixes for 6.12-rc4 2024-10-18 07:01:59 -07:00
sh move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
sparc move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
um move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
x86 x86/traps: move kmsan check after instrumentation_begin 2024-10-28 21:40:39 -07:00
xtensa move asm/unaligned.h to linux/unaligned.h 2024-10-02 17:23:23 -04:00
.gitignore
Kconfig cfi: fix conditions for HAVE_CFI_ICALL_NORMALIZE_INTEGERS 2024-10-13 22:23:13 +02:00