summaryrefslogtreecommitdiff
path: root/uprobe
diff options
context:
space:
mode:
Diffstat (limited to 'uprobe')
-rw-r--r--uprobe/arch/asm-arm/swap_uprobes.c4
-rw-r--r--uprobe/swap_uprobes.c12
-rw-r--r--uprobe/swap_uprobes.h2
3 files changed, 14 insertions, 4 deletions
diff --git a/uprobe/arch/asm-arm/swap_uprobes.c b/uprobe/arch/asm-arm/swap_uprobes.c
index 689b6837..9cf028d2 100644
--- a/uprobe/arch/asm-arm/swap_uprobes.c
+++ b/uprobe/arch/asm-arm/swap_uprobes.c
@@ -718,7 +718,7 @@ static int check_validity_insn(struct kprobe *p, struct pt_regs *regs, struct ta
printk("Error in %s at %d: we are in thumb mode (!) and check instruction was fail \
(%0lX instruction at %p address)!\n", __FILE__, __LINE__, p->opcode, p->addr);
// Test case when we do our actions on already running application
- arch_disarm_uprobe(p, task);
+ disarm_uprobe(p, task);
return -1;
}
} else {
@@ -731,7 +731,7 @@ static int check_validity_insn(struct kprobe *p, struct pt_regs *regs, struct ta
printk("Error in %s at %d: we are in arm mode (!) and check instruction was fail \
(%0lX instruction at %p address)!\n", __FILE__, __LINE__, p->opcode, p->addr);
// Test case when we do our actions on already running application
- arch_disarm_uprobe(p, task);
+ disarm_uprobe(p, task);
return -1;
}
}
diff --git a/uprobe/swap_uprobes.c b/uprobe/swap_uprobes.c
index e773deb6..71558237 100644
--- a/uprobe/swap_uprobes.c
+++ b/uprobe/swap_uprobes.c
@@ -239,6 +239,14 @@ static void arm_uprobe(struct kprobe *p, struct task_struct *task)
}
}
+void disarm_uprobe(struct kprobe *p, struct task_struct *task)
+{
+ if (!write_proc_vm_atomic (task, (unsigned long) p->addr, &p->opcode, sizeof (p->opcode))) {
+ panic("disarm_uprobe: failed to write memory: tgid=%u, addr=%p!\n", task->tgid, p->addr);
+ }
+}
+EXPORT_SYMBOL_GPL(disarm_uprobe);
+
static void init_uprobes_insn_slots(void)
{
int i;
@@ -441,7 +449,7 @@ valid_p:
if ((old_p == p) || ((old_p->pre_handler == aggr_pre_uhandler) &&
(p->list.next == &old_p->list) && (p->list.prev == &old_p->list))) {
/* Only probe on the hash list */
- arch_disarm_uprobe(p, task);
+ disarm_uprobe(p, task);
hlist_del_rcu(&old_p->hlist);
cleanup_p = 1;
} else {
@@ -725,7 +733,7 @@ void dbi_unregister_uretprobe(struct task_struct *task, struct kretprobe *rp, in
} else {
DBPRINTF ("initiating deferred retprobe deletion addr %p", rp->kp.addr);
printk ("initiating deferred retprobe deletion addr %p\n", rp->kp.addr);
- arch_disarm_uprobe(&rp->kp, task);
+ disarm_uprobe(&rp->kp, task);
rp2->disarm = 1;
}
/*
diff --git a/uprobe/swap_uprobes.h b/uprobe/swap_uprobes.h
index 8de84fb7..99f5bf82 100644
--- a/uprobe/swap_uprobes.h
+++ b/uprobe/swap_uprobes.h
@@ -43,4 +43,6 @@ void dbi_unregister_all_uprobes(struct task_struct *task, int atomic);
void dbi_uprobe_return(void);
struct kprobe *get_uprobe(kprobe_opcode_t *addr, pid_t tgid);
+void disarm_uprobe(struct kprobe *p, struct task_struct *task);
+
#endif /* _DBI_UPROBES_H */