diff options
author | Vyacheslav Cherkashin <v.cherkashin@samsung.com> | 2013-03-28 11:40:16 +0400 |
---|---|---|
committer | Vyacheslav Cherkashin <v.cherkashin@samsung.com> | 2013-03-28 12:47:31 +0400 |
commit | e40586aab17b20dd097678107fb15313d122e918 (patch) | |
tree | 4313938b1721e58ff7242c1c8095bb94a8150e43 /uprobe | |
parent | c81377136240ec005c34a6724e55fee32ee4f629 (diff) | |
download | swap-modules-e40586aab17b20dd097678107fb15313d122e918.tar.gz swap-modules-e40586aab17b20dd097678107fb15313d122e918.tar.bz2 swap-modules-e40586aab17b20dd097678107fb15313d122e918.zip |
[REFACTOR] rename and move arch_disarm_uprobe()
rename:
arch_disarm_uprobe() --> disarm_uprobe()
move:
from src/modules/kprobe/arch/dbi_kprobes.c
to src/modules/uprobe/swap_uprobes.c
Diffstat (limited to 'uprobe')
-rw-r--r-- | uprobe/arch/asm-arm/swap_uprobes.c | 4 | ||||
-rw-r--r-- | uprobe/swap_uprobes.c | 12 | ||||
-rw-r--r-- | uprobe/swap_uprobes.h | 2 |
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 */ |