diff options
author | Masami Hiramatsu <mhiramat@kernel.org> | 2020-12-18 15:12:05 +0100 |
---|---|---|
committer | Borislav Petkov <bp@suse.de> | 2021-01-05 15:42:30 +0100 |
commit | abd82e533d88df1521e3da6799b83ce88852ab88 (patch) | |
tree | 04ee6a05cf0553619ad50d302414067c032a7682 /arch/x86/include/asm/kprobes.h | |
parent | Linux 5.11-rc2 (diff) | |
download | linux-abd82e533d88df1521e3da6799b83ce88852ab88.tar.xz linux-abd82e533d88df1521e3da6799b83ce88852ab88.zip |
x86/kprobes: Do not decode opcode in resume_execution()
Currently, kprobes decodes the opcode right after single-stepping in
resume_execution(). But the opcode was already decoded while preparing
arch_specific_insn in arch_copy_kprobe().
Decode the opcode in arch_copy_kprobe() instead of in resume_execution()
and set some flags which classify the opcode for the resuming process.
[ bp: Massage commit message. ]
Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
Signed-off-by: Borislav Petkov <bp@suse.de>
Acked-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Link: https://lkml.kernel.org/r/160830072561.349576.3014979564448023213.stgit@devnote2
Diffstat (limited to 'arch/x86/include/asm/kprobes.h')
-rw-r--r-- | arch/x86/include/asm/kprobes.h | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/arch/x86/include/asm/kprobes.h b/arch/x86/include/asm/kprobes.h index 991a7ad540c7..d20a3d6be36e 100644 --- a/arch/x86/include/asm/kprobes.h +++ b/arch/x86/include/asm/kprobes.h @@ -58,14 +58,17 @@ struct arch_specific_insn { /* copy of the original instruction */ kprobe_opcode_t *insn; /* - * boostable = false: This instruction type is not boostable. - * boostable = true: This instruction has been boosted: we have + * boostable = 0: This instruction type is not boostable. + * boostable = 1: This instruction has been boosted: we have * added a relative jump after the instruction copy in insn, * so no single-step and fixup are needed (unless there's * a post_handler). */ - bool boostable; - bool if_modifier; + unsigned boostable:1; + unsigned if_modifier:1; + unsigned is_call:1; + unsigned is_pushf:1; + unsigned is_abs_ip:1; /* Number of bytes of text poked */ int tp_len; }; |