Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 80293
b: refs/heads/master
c: fb8830e
h: refs/heads/master
i:
  80291: f1ec690
v: v3
  • Loading branch information
Abhishek Sagar authored and Ingo Molnar committed Jan 30, 2008
1 parent 0f82f45 commit c8c1f1b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 16 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: 0723a69a63beec1ca6e792239ef75d0181387ef0
refs/heads/master: fb8830e72d9bd86f1e7b6886cb1886c391130f86
28 changes: 13 additions & 15 deletions trunk/arch/x86/kernel/kprobes.c
Original file line number Diff line number Diff line change
Expand Up @@ -443,17 +443,6 @@ void __kprobes arch_prepare_kretprobe(struct kretprobe_instance *ri,
*sara = (unsigned long) &kretprobe_trampoline;
}

static void __kprobes recursive_singlestep(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;
}

static void __kprobes setup_singlestep(struct kprobe *p, struct pt_regs *regs,
struct kprobe_ctlblk *kcb)
{
Expand Down Expand Up @@ -492,20 +481,29 @@ static int __kprobes reenter_kprobe(struct kprobe *p, struct pt_regs *regs,
break;
#endif
case KPROBE_HIT_ACTIVE:
recursive_singlestep(p, regs, 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;
break;
case KPROBE_HIT_SS:
if (*p->ainsn.insn == BREAKPOINT_INSTRUCTION) {
if (p == kprobe_running()) {
regs->flags &= ~TF_MASK;
regs->flags |= kcb->kprobe_saved_flags;
return 0;
} else {
recursive_singlestep(p, regs, kcb);
/* A probe has been hit in the codepath leading up
* to, or just after, single-stepping of a probed
* instruction. This entire codepath should strictly
* reside in .kprobes.text section. Raise a warning
* to highlight this peculiar case.
*/
}
break;
default:
/* impossible cases */
WARN_ON(1);
return 0;
}

return 1;
Expand Down

0 comments on commit c8c1f1b

Please sign in to comment.