lkml.org 
[lkml]   [2017]   [Feb]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Subject[RFC PATCH 0/2] kprobes/x86: Handle probing on ex_table cases
Date
Hi Peter,

Here, I've tried to handle kprobes on exception expected
instructions which are recorded in __ex_table.

1st patch fixes recover_probed_instruction() to use
probe_kernel_read() instead of memcpy kernel text.
So, if you need to get the original instruction for
checking the cause of #UD, you can use it instead
of probe_kernel_read().

2nd patch adds kprobe_exit_singlestep() right before
fixup_exception(), which fixes regs->ip to point original
address and reset current singlestepping process so that
fixup_exeption() can handle the exception correctly.

There seems some die() still not be fixed up. I'm not
sure we should fix that die() messages too. Would we
better fixup regs->ip in those cases?

Thank you,

---

Masami Hiramatsu (2):
kprobes/x86: Use probe_kernel_read instead of memcpy
kprobes/x86: Exit single-stepping before trying fixup_exception


arch/x86/include/asm/kprobes.h | 1
arch/x86/kernel/kprobes/core.c | 90 +++++++++++++++++++++++++---------------
arch/x86/kernel/kprobes/opt.c | 5 ++
arch/x86/kernel/traps.c | 19 ++++++++
4 files changed, 80 insertions(+), 35 deletions(-)

--
Masami Hiramatsu

\
 
 \ /
  Last update: 2017-02-27 17:14    [W:0.065 / U:1.628 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site