x86/kprobes: Drop removed INT3 handling code
authorMasami Hiramatsu (Google) <mhiramat@kernel.org>
Wed, 30 Nov 2022 13:33:09 +0000 (22:33 +0900)
committerIngo Molnar <mingo@kernel.org>
Sat, 7 Jan 2023 11:29:08 +0000 (12:29 +0100)
commit8e791f7eba4c7711f56616ae163ee3cbc00b1bf4
tree6b0f284c9a0ecbec630373238f79d0ad30c9e088
parent03c4c7f88709fac0e20b6a48357c73d6fc50e544
x86/kprobes: Drop removed INT3 handling code

Drop removed INT3 handling code from kprobe_int3_handler() because this
case (get_kprobe() doesn't return corresponding kprobe AND the INT3 is
removed) must not happen with the kprobe managed INT3, but can happen
with the non-kprobe INT3, which should be handled by other callbacks.

For the kprobe managed INT3, it is already safe. The commit 5c02ece81848d
("x86/kprobes: Fix ordering while text-patching") introduced
text_poke_sync() to the arch_disarm_kprobe() right after removing INT3.
Since this text_poke_sync() uses IPI to call sync_core() on all online
cpus, that ensures that all running INT3 exception handlers have done.
And, the unregister_kprobe() will remove the kprobe from the hash table
after arch_disarm_kprobe().

Thus, when the kprobe managed INT3 hits, kprobe_int3_handler() should
be able to find corresponding kprobe always by get_kprobe(). If it can
not find any kprobe, this means that is NOT a kprobe managed INT3.

Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Reviewed-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Link: https://lore.kernel.org/r/166981518895.1131462.4693062055762912734.stgit@devnote3
arch/x86/kernel/kprobes/core.c