x86/kprobes: Do not decode opcode in resume_execution()
authorMasami Hiramatsu <mhiramat@kernel.org>
Fri, 18 Dec 2020 14:12:05 +0000 (23:12 +0900)
committerBorislav Petkov <bp@suse.de>
Tue, 5 Jan 2021 14:42:30 +0000 (15:42 +0100)
commitabd82e533d88df1521e3da6799b83ce88852ab88
tree04ee6a05cf0553619ad50d302414067c032a7682
parente71ba9452f0b5b2e8dc8aa5445198cd9214a6a62
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
arch/x86/include/asm/kprobes.h
arch/x86/kernel/kprobes/core.c