From cf49f61b8be7d8184505e048318ff6a122933751 Mon Sep 17 00:00:00 2001 From: Shaohua Li Date: Tue, 13 Nov 2007 14:55:20 +0800 Subject: [PATCH] --- yaml --- r: 74767 b: refs/heads/master c: 3661999a17b0397c7a93c200b280c55958ba3593 h: refs/heads/master i: 74765: 0bd1c6b541476d5de9667bb17596ba13045ee749 74763: 67dc996f6eab56458ff7f701239873068f91cb44 74759: 0801c120666591fc0631644cbd63285ec6120a27 74751: 457e822d40f2dce559350c27c3fe8d73daa215fd v: v3 --- [refs] | 2 +- trunk/arch/ia64/kernel/kprobes.c | 19 +++++++++++++++++-- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index 5b6f6ce9cdc4..4d0a1eab5245 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 965d747264c91ed206846d74ae09f757a36a373b +refs/heads/master: 3661999a17b0397c7a93c200b280c55958ba3593 diff --git a/trunk/arch/ia64/kernel/kprobes.c b/trunk/arch/ia64/kernel/kprobes.c index 90518e43aba0..fc4d2676264f 100644 --- a/trunk/arch/ia64/kernel/kprobes.c +++ b/trunk/arch/ia64/kernel/kprobes.c @@ -430,6 +430,23 @@ int __kprobes trampoline_probe_handler(struct kprobe *p, struct pt_regs *regs) * real return address, and all the rest will point to * kretprobe_trampoline */ + hlist_for_each_entry_safe(ri, node, tmp, head, hlist) { + if (ri->task != current) + /* another task is sharing our hash bucket */ + continue; + + orig_ret_address = (unsigned long)ri->ret_addr; + if (orig_ret_address != trampoline_address) + /* + * This is the real return address. Any other + * instances associated with this task are for + * other calls deeper on the call stack + */ + break; + } + + regs->cr_iip = orig_ret_address; + hlist_for_each_entry_safe(ri, node, tmp, head, hlist) { if (ri->task != current) /* another task is sharing our hash bucket */ @@ -452,8 +469,6 @@ int __kprobes trampoline_probe_handler(struct kprobe *p, struct pt_regs *regs) kretprobe_assert(ri, orig_ret_address, trampoline_address); - regs->cr_iip = orig_ret_address; - reset_current_kprobe(); spin_unlock_irqrestore(&kretprobe_lock, flags); preempt_enable_no_resched();