1 Mar 2006 05:40
[PATCH] kprobe: kprobe-booster fix for NX support on i386
Masami Hiramatsu <hiramatu <at> sdl.hitachi.co.jp>
2006-03-01 04:40:45 GMT
2006-03-01 04:40:45 GMT
Hi, Andrew
Here is the patch to fix kprobe-booster against linux-2.6.16-rc5-mm1.
- Fix to assign the correct address of the instruction buffer.
From linux-2.6.16-rc5, the ainsn.insn on i386 arch became a pointer
instead of an array itself.
Best regards,
--
Masami HIRAMATSU
2nd Research Dept.
Hitachi, Ltd., Systems Development Laboratory
E-mail: hiramatu <at> sdl.hitachi.co.jp
Signed-off-by: Masami Hiramatsu <hiramatu <at> sdl.hitachi.co.jp>
kprobes.c | 2 +-
1 files changed, 1 insertion(+), 1 deletion(-)
diff -Narup a/arch/i386/kernel/kprobes.c b/arch/i386/kernel/kprobes.c
--- a/arch/i386/kernel/kprobes.c 2006-03-01 09:53:22.000000000 +0900
+++ b/arch/i386/kernel/kprobes.c 2006-03-01 09:56:58.000000000 +0900
<at> <at> -313,7 +313,7 <at> <at> static int __kprobes kprobe_handler(stru
!p->post_handler && !p->break_handler ) {
/* Boost up -- we can execute copied instructions directly */
reset_current_kprobe();
- regs->eip = (unsigned long)&p->ainsn.insn;
+ regs->eip = (unsigned long)p->ainsn.insn;
preempt_enable_no_resched();
return 1;
(Continue reading)
>
> > [..]The main reason to avoid post_handler execution in this
> > case is to avoid any incosistant data references between pre and post
> > handlers.
> Okay, I got that point, but if the fault recovery in pre_handler
> is *successful*, then in this case you *should* permit calling
> post_handler. See my inline comments to address this issue.
Anil,
To skip post_handler execution for unsuccessful fault recovery in the
pre_hanlder, we need to take several things like aggrigate kprobe
handlers, using the same kprobe structures across the same probe hit on
different cpus at the same time etc. This restricts us from avoiding
execution of the post-handler in case of unsuccessful fault recovery.
Please find the patch below that allows post-handler execution in all
cases as of now.
Thanks
Prasanna
RSS Feed