diff options
-rw-r--r-- | uprobe/arch/asm-arm/swap_uprobes.c | 5 | ||||
-rw-r--r-- | uprobe/arch/asm-arm/swap_uprobes.h | 1 | ||||
-rw-r--r-- | uprobe/arch/asm-x86/swap_uprobes.c | 7 | ||||
-rw-r--r-- | uprobe/arch/asm-x86/swap_uprobes.h | 1 | ||||
-rw-r--r-- | uprobe/swap_uprobes.c | 4 |
5 files changed, 15 insertions, 3 deletions
diff --git a/uprobe/arch/asm-arm/swap_uprobes.c b/uprobe/arch/asm-arm/swap_uprobes.c index 8a39906e..ebbd7973 100644 --- a/uprobe/arch/asm-arm/swap_uprobes.c +++ b/uprobe/arch/asm-arm/swap_uprobes.c @@ -716,6 +716,11 @@ void arch_set_orig_ret_addr(unsigned long orig_ret_addr, struct pt_regs *regs) regs->ARM_cpsr &= ~PSR_T_BIT; } +void arch_remove_uprobe(struct uprobe *up) +{ + swap_slot_free(up->sm, up->atramp.utramp); +} + static void restore_opcode_for_thumb(struct kprobe *p, struct pt_regs *regs) { if (thumb_mode(regs) && !is_thumb2(p->opcode)) { diff --git a/uprobe/arch/asm-arm/swap_uprobes.h b/uprobe/arch/asm-arm/swap_uprobes.h index 8efb0e74..a89af747 100644 --- a/uprobe/arch/asm-arm/swap_uprobes.h +++ b/uprobe/arch/asm-arm/swap_uprobes.h @@ -73,6 +73,7 @@ int arch_disarm_urp_inst(struct uretprobe_instance *ri, unsigned long arch_get_trampoline_addr(struct kprobe *p, struct pt_regs *regs); void arch_set_orig_ret_addr(unsigned long orig_ret_addr, struct pt_regs *regs); +void arch_remove_uprobe(struct uprobe *up); static inline unsigned long swap_get_uarg(struct pt_regs *regs, unsigned long n) { diff --git a/uprobe/arch/asm-x86/swap_uprobes.c b/uprobe/arch/asm-x86/swap_uprobes.c index 19ae1dac..85a12aa3 100644 --- a/uprobe/arch/asm-x86/swap_uprobes.c +++ b/uprobe/arch/asm-x86/swap_uprobes.c @@ -180,6 +180,13 @@ void arch_set_orig_ret_addr(unsigned long orig_ret_addr, struct pt_regs *regs) regs->EREG(ip) = orig_ret_addr; } +void arch_remove_uprobe(struct uprobe *up) +{ + struct kprobe *p = up2kp(up); + + swap_slot_free(up->sm, p->ainsn.insn); +} + static void set_user_jmp_op(void *from, void *to) { struct __arch_jmp_op diff --git a/uprobe/arch/asm-x86/swap_uprobes.h b/uprobe/arch/asm-x86/swap_uprobes.h index 100f2634..a0ae4d4c 100644 --- a/uprobe/arch/asm-x86/swap_uprobes.h +++ b/uprobe/arch/asm-x86/swap_uprobes.h @@ -77,6 +77,7 @@ int arch_disarm_urp_inst(struct uretprobe_instance *ri, struct task_struct *task); unsigned long arch_get_trampoline_addr(struct kprobe *p, struct pt_regs *regs); void arch_set_orig_ret_addr(unsigned long orig_ret_addr, struct pt_regs *regs); +void arch_remove_uprobe(struct uprobe *up); static inline unsigned long swap_get_uarg(struct pt_regs *regs, unsigned long n) { diff --git a/uprobe/swap_uprobes.c b/uprobe/swap_uprobes.c index 2d22754b..7a5e2779 100644 --- a/uprobe/swap_uprobes.c +++ b/uprobe/swap_uprobes.c @@ -323,9 +323,7 @@ struct kprobe *get_ukprobe_by_insn_slot(void *addr, pid_t tgid, struct pt_regs * static void remove_uprobe(struct uprobe *up) { - struct kprobe *p = up2kp(up); - - swap_slot_free(up->sm, p->ainsn.insn); + arch_remove_uprobe(up); } static struct hlist_head *uretprobe_inst_table_head(void *hash_key) |