aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorMasami Hiramatsu <mhiramat@kernel.org>2020-05-12 17:03:07 +0900
committerSteven Rostedt (VMware) <rostedt@goodmis.org>2020-06-16 21:21:01 -0400
commit75ddf64dd276e3fc8906f27549afa229798ad916 (patch)
tree78b5a1ca223f240ca44ef3d90286361776092fac
parentkprobes: Fix to protect kick_kprobe_optimizer() by kprobe_mutex (diff)
downloadwireguard-linux-75ddf64dd276e3fc8906f27549afa229798ad916.tar.xz
wireguard-linux-75ddf64dd276e3fc8906f27549afa229798ad916.zip
kprobes: Remove redundant arch_disarm_kprobe() call
Fix to remove redundant arch_disarm_kprobe() call in force_unoptimize_kprobe(). This arch_disarm_kprobe() will be invoked if the kprobe is optimized but disabled, but that means the kprobe (optprobe) is unused (and unoptimized) state. In that case, unoptimize_kprobe() puts it in freeing_list and kprobe_optimizer (do_unoptimize_kprobes()) automatically disarm it. Thus this arch_disarm_kprobe() is redundant. Link: http://lkml.kernel.org/r/158927058719.27680.17183632908465341189.stgit@devnote2 Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
-rw-r--r--kernel/kprobes.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/kernel/kprobes.c b/kernel/kprobes.c
index 0e185763578b..5cb7791c16b3 100644
--- a/kernel/kprobes.c
+++ b/kernel/kprobes.c
@@ -675,8 +675,6 @@ static void force_unoptimize_kprobe(struct optimized_kprobe *op)
lockdep_assert_cpus_held();
arch_unoptimize_kprobe(op);
op->kp.flags &= ~KPROBE_FLAG_OPTIMIZED;
- if (kprobe_disabled(&op->kp))
- arch_disarm_kprobe(&op->kp);
}
/* Unoptimize a kprobe if p is optimized */