Message ID | 157140289814.29376.7139596484011081680.tip-bot2@tip-bot2 (mailing list archive) |
---|---|
State | Accepted |
Commit | 004e8dce9c5595697951f7cd0e9f66b35c92265e |
Headers | show |
Series | [tip:,x86/core] x86: kprobes: Prohibit probing on instruction which has emulate prefix | expand |
diff --git a/arch/x86/kernel/kprobes/core.c b/arch/x86/kernel/kprobes/core.c index 43fc13c..4f13af7 100644 --- a/arch/x86/kernel/kprobes/core.c +++ b/arch/x86/kernel/kprobes/core.c @@ -351,6 +351,10 @@ int __copy_instruction(u8 *dest, u8 *src, u8 *real, struct insn *insn) kernel_insn_init(insn, dest, MAX_INSN_SIZE); insn_get_length(insn); + /* We can not probe force emulate prefixed instruction */ + if (insn_has_emulate_prefix(insn)) + return 0; + /* Another subsystem puts a breakpoint, failed to recover */ if (insn->opcode.bytes[0] == BREAKPOINT_INSTRUCTION) return 0;