linux-stable/arch
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
..
alpha MM patches for 6.2-rc1. 2022-12-13 19:29:45 -08:00
arc MM patches for 6.2-rc1. 2022-12-13 19:29:45 -08:00
arm ARM: SoC fixes for 6.2 2022-12-19 16:07:59 -06:00
arm64 remoteproc updates for v6.2 2022-12-21 09:37:14 -08:00
csky arch/csky patches for 6.2-rc1 2022-12-19 07:51:30 -06:00
hexagon MM patches for 6.2-rc1. 2022-12-13 19:29:45 -08:00
ia64 - Add the call depth tracking mitigation for Retbleed which has 2022-12-14 15:03:00 -08:00
loongarch LoongArch changes for v6.2 2022-12-19 08:23:27 -06:00
m68k m68k: remove broken strcmp implementation 2022-12-21 08:56:43 -08:00
microblaze MM patches for 6.2-rc1. 2022-12-13 19:29:45 -08:00
mips Fixes due to DT changes 2022-12-23 10:49:45 -08:00
nios2 MM patches for 6.2-rc1. 2022-12-13 19:29:45 -08:00
openrisc MM patches for 6.2-rc1. 2022-12-13 19:29:45 -08:00
parisc parisc architecture fixes for kernel v6.2-rc1: 2022-12-20 08:43:53 -06:00
powerpc random: do not include <asm/archrandom.h> from random.h 2022-12-20 03:13:45 +01:00
riscv KVM/riscv changes for 6.2 2022-12-21 18:52:15 -08:00
s390 random: do not include <asm/archrandom.h> from random.h 2022-12-20 03:13:45 +01:00
sh treewide: Convert del_timer*() to timer_shutdown*() 2022-12-25 13:38:09 -08:00
sparc MM patches for 6.2-rc1. 2022-12-13 19:29:45 -08:00
um New Feature: 2022-12-17 14:06:53 -06:00
x86 x86/kprobes: Fix kprobes instruction boudary check with CONFIG_RETHUNK 2022-12-27 12:51:58 +01:00
xtensa MM patches for 6.2-rc1. 2022-12-13 19:29:45 -08:00
.gitignore
Kconfig arm64 fixes for -rc1 2022-12-16 13:46:41 -06:00