x86/kprobes: Fix to identify indirect jmp and others using range case
authorMasami Hiramatsu <mhiramat@kernel.org>
Thu, 25 Mar 2021 10:08:43 +0000 (19:08 +0900)
committerIngo Molnar <mingo@kernel.org>
Thu, 25 Mar 2021 10:37:22 +0000 (11:37 +0100)
commit2f706e0e5e263c0d204e37ea496cbb0e98aac2d2
tree1f1362f260b2ff92bbce0d932495ecb45774570c
parent6dd3b8c9f58816a1354be39559f630cd1bd12159
x86/kprobes: Fix to identify indirect jmp and others using range case

Fix can_boost() to identify indirect jmp and others using range case
correctly.

Since the condition in switch statement is opcode & 0xf0, it can not
evaluate to 0xff case. This should be under the 0xf0 case. However,
there is no reason to use the conbinations of the bit-masked condition
and lower bit checking.

Use range case to clean up the switch statement too.

Fixes: 6256e668b7 ("x86/kprobes: Use int3 instead of debug trap for single-step")
Reported-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Link: https://lore.kernel.org/r/161666692308.1120877.4675552834049546493.stgit@devnote2
arch/x86/kernel/kprobes/core.c