[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <148821192807.15765.16863626307263805313.stgit@devbox>
Date: Tue, 28 Feb 2017 01:12:18 +0900
From: Masami Hiramatsu <mhiramat@...nel.org>
To: Peter Zijlstra <peterz@...radead.org>
Cc: Masami Hiramatsu <mhiramat@...nel.org>,
Borislav Petkov <bp@...en8.de>, linux-kernel@...r.kernel.org,
Ingo Molnar <mingo@...nel.org>,
Thomas Gleixner <tglx@...utronix.de>
Subject: [RFC PATCH 0/2] kprobes/x86: Handle probing on ex_table cases
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
Powered by blists - more mailing lists