Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1588792
| From | Masami Hiramatsu <mhiramat@kernel.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [RFC PATCH 0/2] kprobes/x86: Handle probing on ex_table cases |
| Date | 2017-02-27 17:20 +0100 |
| Message-ID | <tfwbL-82e-9@gated-at.bofh.it> (permalink) |
| References | <tesad-3vj-11@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
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
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
kprobes vs __ex_table[] Peter Zijlstra <peterz@infradead.org> - 2017-02-23 19:40 +0100
Re: kprobes vs __ex_table[] Masami Hiramatsu <mhiramat@kernel.org> - 2017-02-24 02:10 +0100
Re: kprobes vs __ex_table[] Peter Zijlstra <peterz@infradead.org> - 2017-02-24 10:30 +0100
Re: kprobes vs __ex_table[] Masami Hiramatsu <mhiramat@kernel.org> - 2017-02-24 17:40 +0100
Re: kprobes vs __ex_table[] Peter Zijlstra <peterz@infradead.org> - 2017-02-24 18:50 +0100
[RFC PATCH 1/2] kprobes/x86: Use probe_kernel_read instead of memcpy Masami Hiramatsu <mhiramat@kernel.org> - 2017-02-27 17:20 +0100
[RFC PATCH 2/2] kprobes/x86: Exit single-stepping before trying fixup_exception Masami Hiramatsu <mhiramat@kernel.org> - 2017-02-27 17:20 +0100
[RFC PATCH 0/2] kprobes/x86: Handle probing on ex_table cases Masami Hiramatsu <mhiramat@kernel.org> - 2017-02-27 17:20 +0100
Re: kprobes vs __ex_table[] Masami Hiramatsu <mhiramat@kernel.org> - 2017-02-28 17:30 +0100
[PATCH] [BUGFIX] kprobes/x86: Fix to check __ex_table entry by probed address Masami Hiramatsu <mhiramat@kernel.org> - 2017-02-28 18:50 +0100
csiph-web