[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH -tip 2/2] x86: kprobes: Prohibit probing on instruction which has Xen prefix



Prohibit probing on instruction which has XEN_EMULATE_PREFIX
(it must be cpuid.) Since that prefix is a marker for Xen,
if we modify the marker by kprobe's int3, that doesn't work
as expected.

Signed-off-by: Masami Hiramatsu <mhiramat@xxxxxxxxxx>
---
 arch/x86/kernel/kprobes/core.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/x86/kernel/kprobes/core.c b/arch/x86/kernel/kprobes/core.c
index 43fc13c831af..b1e86af4a985 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 XEN_EMULATE_PREFIX instruction */
+       if (insn_has_xen_prefix(insn))
+               return 0;
+
        /* Another subsystem puts a breakpoint, failed to recover */
        if (insn->opcode.bytes[0] == BREAKPOINT_INSTRUCTION)
                return 0;


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.