Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 80089
b: refs/heads/master
c: 40102d4
h: refs/heads/master
i:
  80087: c1e8212
v: v3
  • Loading branch information
Harvey Harrison authored and Ingo Molnar committed Jan 30, 2008
1 parent dcc1d6d commit 82b14ca
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 12 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ddc66df876fd33d3956f3c3acc1ae334b16eedee
refs/heads/master: 40102d4a41312ad4134c0b802ad074445ce8b17b
26 changes: 15 additions & 11 deletions trunk/arch/x86/kernel/kprobes.c
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,20 @@ void __kprobes arch_prepare_kretprobe(struct kretprobe_instance *ri,
/* Replace the return addr with trampoline addr */
*sara = (unsigned long) &kretprobe_trampoline;
}
/*
* We have reentered the kprobe_handler(), since another probe was hit while
* within the handler. We save the original kprobes variables and just single
* step on the instruction of the new probe without calling any user handlers.
*/
static void __kprobes reenter_kprobe(struct kprobe *p, struct pt_regs *regs,
struct kprobe_ctlblk *kcb)
{
save_previous_kprobe(kcb);
set_current_kprobe(p, regs, kcb);
kprobes_inc_nmissed_count(p);
prepare_singlestep(p, regs);
kcb->kprobe_status = KPROBE_REENTER;
}

/*
* Interrupts are disabled on entry as trap3 is an interrupt gate and they
Expand Down Expand Up @@ -471,17 +485,7 @@ static int __kprobes kprobe_handler(struct pt_regs *regs)
goto no_kprobe;
#endif
}
/* We have reentered the kprobe_handler(), since
* another probe was hit while within the handler.
* We here save the original kprobes variables and
* just single step on the instruction of the new probe
* without calling any user handlers.
*/
save_previous_kprobe(kcb);
set_current_kprobe(p, regs, kcb);
kprobes_inc_nmissed_count(p);
prepare_singlestep(p, regs);
kcb->kprobe_status = KPROBE_REENTER;
reenter_kprobe(p, regs, kcb);
return 1;
} else {
if (*addr != BREAKPOINT_INSTRUCTION) {
Expand Down

0 comments on commit 82b14ca

Please sign in to comment.