[Patch] Kprobes: bugfix of kprobe-booster: reenable kprobe-booster

From: Satoshi Oshima
Date: Fri May 19 2006 - 16:13:14 EST

Hi Andrew,

I found a bug of kprobes in i386.

Kprobe-booster doesn't work if CONFIG_PREEMPT is not set.
Because pre_preempt_count is always 0.

Boostability have been disabled when removing '#ifdef

This bug doesn't cause a kernel panic.


Satoshi Oshima

Signed-off-by: Satoshi Oshima <soshima@xxxxxxxxxx>

diff -Narup linux-2.6.17-rc3-mm1.orig/arch/i386/kernel/kprobes.c kprobes-i386-bugfix/arch/i386/kernel/kprobes.c
--- linux-2.6.17-rc3-mm1.orig/arch/i386/kernel/kprobes.c 2006-05-04 12:34:46.000000000 -0400
+++ kprobes-i386-bugfix/arch/i386/kernel/kprobes.c 2006-05-12 15:41:23.000000000 -0400
@@ -257,7 +257,11 @@ static int __kprobes kprobe_handler(stru
int ret = 0;
kprobe_opcode_t *addr;
struct kprobe_ctlblk *kcb;
unsigned pre_preempt_count = preempt_count();
+ unsigned pre_preempt_count = 1;

addr = (kprobe_opcode_t *)(regs->eip - sizeof(kprobe_opcode_t));

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/