diff options
author | Anton Arapov <anton@redhat.com> | 2013-04-03 18:00:34 +0200 |
---|---|---|
committer | Oleg Nesterov <oleg@redhat.com> | 2013-04-13 15:31:56 +0200 |
commit | f15706b79d6f71e016cd06afa21ee31500029067 (patch) | |
tree | 412045d4bd7922482a25eaaab76e741b8b457ea4 /arch/powerpc/kernel/uprobes.c | |
parent | uretprobes/x86: Hijack return address (diff) | |
download | linux-f15706b79d6f71e016cd06afa21ee31500029067.tar.xz linux-f15706b79d6f71e016cd06afa21ee31500029067.zip |
uretprobes/powerpc: Hijack return address
Hijack the return address and replace it with a trampoline address.
PowerPC implementation.
Signed-off-by: Anton Arapov <anton@redhat.com>
Acked-by: Ananth N Mavinakayanahalli <ananth@in.ibm.com>
Acked-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Diffstat (limited to 'arch/powerpc/kernel/uprobes.c')
-rw-r--r-- | arch/powerpc/kernel/uprobes.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/arch/powerpc/kernel/uprobes.c b/arch/powerpc/kernel/uprobes.c index 2ecdbe304f46..59f419b935f2 100644 --- a/arch/powerpc/kernel/uprobes.c +++ b/arch/powerpc/kernel/uprobes.c @@ -192,3 +192,16 @@ bool arch_uprobe_skip_sstep(struct arch_uprobe *auprobe, struct pt_regs *regs) return false; } + +unsigned long +arch_uretprobe_hijack_return_addr(unsigned long trampoline_vaddr, struct pt_regs *regs) +{ + unsigned long orig_ret_vaddr; + + orig_ret_vaddr = regs->link; + + /* Replace the return addr with trampoline addr */ + regs->link = trampoline_vaddr; + + return orig_ret_vaddr; +} |