diff options
author | Vasiliy Ulyanov <v.ulyanov@samsung.com> | 2014-04-10 15:33:11 +0400 |
---|---|---|
committer | Vasiliy Ulyanov <v.ulyanov@samsung.com> | 2014-04-21 17:41:19 +0400 |
commit | 4c2e04cf31901e602107c50762536659cc4fb151 (patch) | |
tree | b4d32f8c6b13b1ae8fe0e5ac1cbf18fac38e4732 /uprobe/arch | |
parent | 3729ea9622af80dec7f2dc616e0991be6f7709ba (diff) | |
download | swap-modules-4c2e04cf31901e602107c50762536659cc4fb151.tar.gz swap-modules-4c2e04cf31901e602107c50762536659cc4fb151.tar.bz2 swap-modules-4c2e04cf31901e602107c50762536659cc4fb151.zip |
[FIX] ARM: map US insn slots at uprobe registration
User pages mapping moved out of exception context
Change-Id: I8239d0ee2d01fad137988d08ba696b770f978ae2
Signed-off-by: Vasiliy Ulyanov <v.ulyanov@samsung.com>
Diffstat (limited to 'uprobe/arch')
-rw-r--r-- | uprobe/arch/asm-arm/swap_uprobes.c | 8 | ||||
-rw-r--r-- | uprobe/arch/asm-arm/swap_uprobes.h | 1 |
2 files changed, 8 insertions, 1 deletions
diff --git a/uprobe/arch/asm-arm/swap_uprobes.c b/uprobe/arch/asm-arm/swap_uprobes.c index 120226fc..7c72478a 100644 --- a/uprobe/arch/asm-arm/swap_uprobes.c +++ b/uprobe/arch/asm-arm/swap_uprobes.c @@ -564,6 +564,12 @@ int arch_prepare_uprobe(struct uprobe *up) return -EFAULT; } + up->atramp.utramp = alloc_insn_slot(up->sm); + if (up->atramp.utramp == NULL) { + printk("Error: alloc_insn_slot failed (%08lx)\n", vaddr); + return -ENOMEM; + } + return 0; } @@ -760,7 +766,7 @@ static int make_trampoline(struct uprobe *up, struct pt_regs *regs) return 1; } - utramp = alloc_insn_slot(up->sm); + utramp = up->atramp.utramp; if (!write_proc_vm_atomic(up->task, (unsigned long)utramp, tramp, UPROBES_TRAMP_LEN * sizeof(*tramp))) diff --git a/uprobe/arch/asm-arm/swap_uprobes.h b/uprobe/arch/asm-arm/swap_uprobes.h index 74f4cb35..3ba18690 100644 --- a/uprobe/arch/asm-arm/swap_uprobes.h +++ b/uprobe/arch/asm-arm/swap_uprobes.h @@ -42,6 +42,7 @@ struct uretprobe_instance; struct arch_specific_tramp { unsigned long tramp_arm[UPROBES_TRAMP_LEN]; unsigned long tramp_thumb[UPROBES_TRAMP_LEN]; + void *utramp; }; |