summaryrefslogtreecommitdiff
path: root/uprobe
diff options
context:
space:
mode:
Diffstat (limited to 'uprobe')
-rw-r--r--uprobe/arch/asm-arm/swap_uprobes.c2
-rw-r--r--uprobe/swap_uprobes.c15
-rw-r--r--uprobe/swap_uprobes.h1
3 files changed, 16 insertions, 2 deletions
diff --git a/uprobe/arch/asm-arm/swap_uprobes.c b/uprobe/arch/asm-arm/swap_uprobes.c
index dea907bf..c35e7d0d 100644
--- a/uprobe/arch/asm-arm/swap_uprobes.c
+++ b/uprobe/arch/asm-arm/swap_uprobes.c
@@ -672,7 +672,7 @@ int trampoline_uprobe_handler(struct kprobe *p, struct pt_regs *regs)
}
orig_ret_address = (unsigned long)ri->ret_addr;
- recycle_rp_inst(ri);
+ recycle_urp_inst(ri);
if (orig_ret_address != trampoline_address) {
/*
diff --git a/uprobe/swap_uprobes.c b/uprobe/swap_uprobes.c
index 56cb7b98..6e7bc4bf 100644
--- a/uprobe/swap_uprobes.c
+++ b/uprobe/swap_uprobes.c
@@ -413,6 +413,19 @@ static void add_urp_inst(struct kretprobe_instance *ri)
}
/* Called with uretprobe_lock held */
+void recycle_urp_inst(struct kretprobe_instance *ri)
+{
+ if (ri->rp) {
+ hlist_del(&ri->hlist);
+ /* remove rp inst off the used list */
+ hlist_del(&ri->uflist);
+ /* put rp inst back onto the free list */
+ INIT_HLIST_NODE(&ri->uflist);
+ hlist_add_head(&ri->uflist, &ri->rp->free_instances);
+ }
+}
+
+/* Called with uretprobe_lock held */
static struct kretprobe_instance *get_used_urp_inst(struct kretprobe *rp)
{
struct hlist_node *node;
@@ -841,7 +854,7 @@ void dbi_unregister_uretprobe(struct task_struct *task, struct kretprobe *rp, in
/*panic*/printk("%s (%d/%d): cannot disarm urp instance (%08lx)\n",
ri->task->comm, ri->task->tgid, ri->task->pid,
(unsigned long)rp->kp.addr);
- recycle_rp_inst(ri);
+ recycle_urp_inst(ri);
}
if (hlist_empty(&rp->used_instances) || not_rp2) {
diff --git a/uprobe/swap_uprobes.h b/uprobe/swap_uprobes.h
index 0385c1fc..5b6d5d2d 100644
--- a/uprobe/swap_uprobes.h
+++ b/uprobe/swap_uprobes.h
@@ -47,5 +47,6 @@ void disarm_uprobe(struct kprobe *p, struct task_struct *task);
extern spinlock_t uretprobe_lock;
struct hlist_head *uretprobe_inst_table_head(void *hash_key);
+void recycle_urp_inst(struct kretprobe_instance *ri);
#endif /* _DBI_UPROBES_H */