diff options
author | Vyacheslav Cherkashin <v.cherkashin@samsung.com> | 2013-04-01 12:35:27 +0400 |
---|---|---|
committer | Vyacheslav Cherkashin <v.cherkashin@samsung.com> | 2013-04-01 12:35:27 +0400 |
commit | da7fdbccf6883d9d351204adeef57e6f269f1306 (patch) | |
tree | cb1acc7d6446ad1fba480a0cfe4f17eeb58360d3 /uprobe | |
parent | ec905d585bdb62e8052b638b03797bde7bfd5685 (diff) | |
download | swap-modules-da7fdbccf6883d9d351204adeef57e6f269f1306.tar.gz swap-modules-da7fdbccf6883d9d351204adeef57e6f269f1306.tar.bz2 swap-modules-da7fdbccf6883d9d351204adeef57e6f269f1306.zip |
[REFACTOR] new interface check_validity_insn()
-static int check_validity_insn(struct kprobe *p, struct pt_regs *regs, struct task_struct *task)
+static int check_validity_insn(struct uprobe *up, struct pt_regs *regs)
Diffstat (limited to 'uprobe')
-rw-r--r-- | uprobe/arch/asm-arm/swap_uprobes.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/uprobe/arch/asm-arm/swap_uprobes.c b/uprobe/arch/asm-arm/swap_uprobes.c index eefe8331..386b0830 100644 --- a/uprobe/arch/asm-arm/swap_uprobes.c +++ b/uprobe/arch/asm-arm/swap_uprobes.c @@ -645,10 +645,11 @@ void arch_set_orig_ret_addr(unsigned long orig_ret_addr, struct pt_regs *regs) } } -static int check_validity_insn(struct kprobe *p, struct pt_regs *regs, struct task_struct *task) +static int check_validity_insn(struct uprobe *up, struct pt_regs *regs) { - struct kprobe *kp; + struct kprobe *kp, *p; + p = &up->kp; if (unlikely(thumb_mode(regs))) { if (p->safe_thumb != -1) { p->ainsn.insn = p->ainsn.insn_thumb; @@ -659,7 +660,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 - disarm_uprobe(p, task); + disarm_uprobe(p, up->task); return -1; } } else { @@ -672,7 +673,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 - disarm_uprobe(p, task); + disarm_uprobe(p, up->task); return -1; } } @@ -685,11 +686,13 @@ static int uprobe_handler(struct pt_regs *regs) kprobe_opcode_t *addr = (kprobe_opcode_t *)(regs->ARM_pc); struct task_struct *task = current; pid_t tgid = task->tgid; + struct uprobe *up; struct kprobe *p; - p = &get_uprobe(addr, tgid)->kp; + up = get_uprobe(addr, tgid); + p = &up->kp; - if (p && (check_validity_insn(p, regs, task) != 0)) { + if (p && (check_validity_insn(up, regs) != 0)) { printk("no_uprobe live\n"); return 0; } |