Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 54644
b: refs/heads/master
c: 0f95b7f
h: refs/heads/master
v: v3
  • Loading branch information
Ananth N Mavinakayanahalli authored and Linus Torvalds committed May 8, 2007
1 parent 5d3c62f commit d4f1035
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 6 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: 8f0c45cdf87dc9141e87b0ad2fc6fff216a95f79
refs/heads/master: 0f95b7fc839bc3272b1bf2325d8748a649bd3534
3 changes: 1 addition & 2 deletions trunk/arch/i386/kernel/kprobes.c
Original file line number Diff line number Diff line change
Expand Up @@ -449,8 +449,7 @@ fastcall void *__kprobes trampoline_handler(struct pt_regs *regs)
break;
}

BUG_ON(!orig_ret_address || (orig_ret_address == trampoline_address));

kretprobe_assert(ri, orig_ret_address, trampoline_address);
spin_unlock_irqrestore(&kretprobe_lock, flags);

hlist_for_each_entry_safe(ri, node, tmp, &empty_rp, hlist) {
Expand Down
3 changes: 2 additions & 1 deletion trunk/arch/ia64/kernel/kprobes.c
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,8 @@ int __kprobes trampoline_probe_handler(struct kprobe *p, struct pt_regs *regs)
break;
}

BUG_ON(!orig_ret_address || (orig_ret_address == trampoline_address));
kretprobe_assert(ri, orig_ret_address, trampoline_address);

regs->cr_iip = orig_ret_address;

reset_current_kprobe();
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/powerpc/kernel/kprobes.c
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ int __kprobes trampoline_probe_handler(struct kprobe *p, struct pt_regs *regs)
break;
}

BUG_ON(!orig_ret_address || (orig_ret_address == trampoline_address));
kretprobe_assert(ri, orig_ret_address, trampoline_address);
regs->nip = orig_ret_address;

reset_current_kprobe();
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/x86_64/kernel/kprobes.c
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ int __kprobes trampoline_probe_handler(struct kprobe *p, struct pt_regs *regs)
break;
}

BUG_ON(!orig_ret_address || (orig_ret_address == trampoline_address));
kretprobe_assert(ri, orig_ret_address, trampoline_address);
regs->rip = orig_ret_address;

reset_current_kprobe();
Expand Down
10 changes: 10 additions & 0 deletions trunk/include/linux/kprobes.h
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,16 @@ struct kretprobe_instance {
struct task_struct *task;
};

static inline void kretprobe_assert(struct kretprobe_instance *ri,
unsigned long orig_ret_address, unsigned long trampoline_address)
{
if (!orig_ret_address || (orig_ret_address == trampoline_address)) {
printk("kretprobe BUG!: Processing kretprobe %p @ %p\n",
ri->rp, ri->rp->kp.addr);
BUG();
}
}

extern spinlock_t kretprobe_lock;
extern struct mutex kprobe_mutex;
extern int arch_prepare_kprobe(struct kprobe *p);
Expand Down

0 comments on commit d4f1035

Please sign in to comment.