linux-stable/arch/x86
Masami Hiramatsu (Google) 1993bf9799 x86/kprobes: Fix kprobes instruction boudary check with CONFIG_RETHUNK
Since the CONFIG_RETHUNK and CONFIG_SLS will use INT3 for stopping
speculative execution after RET instruction, kprobes always failes to
check the probed instruction boundary by decoding the function body if
the probed address is after such sequence. (Note that some conditional
code blocks will be placed after function return, if compiler decides
it is not on the hot path.)

This is because kprobes expects kgdb puts the INT3 as a software
breakpoint and it will replace the original instruction.
But these INT3 are not such purpose, it doesn't need to recover the
original instruction.

To avoid this issue, kprobes checks whether the INT3 is owned by
kgdb or not, and if so, stop decoding and make it fail. The other
INT3 will come from CONFIG_RETHUNK/CONFIG_SLS and those can be
treated as a one-byte instruction.

Fixes: e463a09af2 ("x86: Add straight-line-speculation mitigation")
Suggested-by: Peter Zijlstra <peterz@infradead.org>
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/167146051026.1374301.392728975473572291.stgit@devnote3
2022-12-27 12:51:58 +01:00
..
boot - Add the call depth tracking mitigation for Retbleed which has 2022-12-14 15:03:00 -08:00
coco x86/tdx: Add a wrapper to get TDREPORT0 from the TDX Module 2022-11-17 11:03:09 -08:00
configs x86/defconfig: Enable CONFIG_DEBUG_WX=y 2022-09-02 10:41:42 +02:00
crypto - Add the call depth tracking mitigation for Retbleed which has 2022-12-14 15:03:00 -08:00
entry - Add the call depth tracking mitigation for Retbleed which has 2022-12-14 15:03:00 -08:00
events ARM64: 2022-12-15 11:12:21 -08:00
hyperv x86/hyperv: Remove unregister syscore call from Hyper-V cleanup 2022-11-29 17:55:29 +00:00
ia32 x86/signal/32: Merge native and compat 32-bit signal code 2022-10-19 09:58:49 +02:00
include New Feature: 2022-12-17 14:06:53 -06:00
kernel x86/kprobes: Fix kprobes instruction boudary check with CONFIG_RETHUNK 2022-12-27 12:51:58 +01:00
kvm ARM64: 2022-12-15 11:12:21 -08:00
lib - Add the call depth tracking mitigation for Retbleed which has 2022-12-14 15:03:00 -08:00
math-emu
mm prandom: remove prandom_u32_max() 2022-12-20 03:13:45 +01:00
net - Add the call depth tracking mitigation for Retbleed which has 2022-12-14 15:03:00 -08:00
pci x86/PCI: Use pr_info() when possible 2022-12-10 10:33:18 -06:00
platform pci-v6.2-changes 2022-12-14 09:54:10 -08:00
power - Add the call depth tracking mitigation for Retbleed which has 2022-12-14 15:03:00 -08:00
purgatory x86/purgatory: disable KMSAN instrumentation 2022-10-28 13:37:23 -07:00
ras
realmode x86/boot: Skip realmode init code when running as Xen PV guest 2022-11-25 12:05:22 +01:00
tools x86/tools/relocs: Ignore __kcfi_typeid_ relocations 2022-09-26 10:13:15 -07:00
um [elf][non-regset] uninline elf_core_copy_task_fpregs() (and lose pt_regs argument) 2022-11-24 23:24:23 -05:00
video
virt/vmx/tdx
xen - Add the call depth tracking mitigation for Retbleed which has 2022-12-14 15:03:00 -08:00
.gitignore x86/purgatory: Omit use of bin2c 2022-07-25 10:32:32 +02:00
Kbuild
Kconfig powerpc updates for 6.2 2022-12-19 07:13:33 -06:00
Kconfig.assembler
Kconfig.cpu
Kconfig.debug arch: make TRACE_IRQFLAGS_NMI_SUPPORT generic 2022-06-23 15:39:21 +01:00
Makefile Kbuild updates for v6.2 2022-12-19 12:33:32 -06:00
Makefile.um
Makefile_32.cpu