Skip to content
Commit f899baf6 authored by Masami Hiramatsu (Google)'s avatar Masami Hiramatsu (Google) Committed by Greg Kroah-Hartman
Browse files

x86/kprobes: Fix optprobe optimization check with CONFIG_RETHUNK

[ Upstream commit 63dc6325 ]

Since the CONFIG_RETHUNK and CONFIG_SLS will use INT3 for stopping
speculative execution after function return, kprobe jump optimization
always fails on the functions with such INT3 inside the function body.
(It already checks the INT3 padding between functions, but not inside
 the function)

To avoid this issue, as same as kprobes, check whether the INT3 comes
from 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: e463a09a

 ("x86: Add straight-line-speculation mitigation")
Suggested-by: default avatarPeter Zijlstra <peterz@infradead.org>
Signed-off-by: default avatarMasami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/167146051929.1374301.7419382929328081706.stgit@devnote3


Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 5d112deb
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment