diff options
| author | William Cohen <wcohen@redhat.com> | 2016-07-08 12:35:52 -0400 |
|---|---|---|
| committer | Alex Shi <alex.shi@linaro.org> | 2016-10-20 15:38:13 +0800 |
| commit | aecc244b48b51e2ce0f1fefd3111ba6d6548d0ce (patch) | |
| tree | cb9d3864f6b3ae52cbf61659209651a4c1bf20eb /arch/arm64/kernel/probes/kprobes.c | |
| parent | 1f4a59d0e95a8b5a1a3e35080b4e6b579d6b2f52 (diff) | |
arm64: Add trampoline code for kretprobes
commit da6a91252ad98d49b49e83b76c1f032cdf6e5258 upstream.
The trampoline code is used by kretprobes to capture a return from a probed
function. This is done by saving the registers, calling the handler, and
restoring the registers. The code then returns to the original saved caller
return address. It is necessary to do this directly instead of using a
software breakpoint because the code used in processing that breakpoint
could itself be kprobe'd and cause a problematic reentry into the debug
exception handler.
Signed-off-by: William Cohen <wcohen@redhat.com>
Signed-off-by: David A. Long <dave.long@linaro.org>
Acked-by: Masami Hiramatsu <mhiramat@kernel.org>
[catalin.marinas@arm.com: removed unnecessary masking of the PSTATE bits]
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Diffstat (limited to 'arch/arm64/kernel/probes/kprobes.c')
| -rw-r--r-- | arch/arm64/kernel/probes/kprobes.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/arch/arm64/kernel/probes/kprobes.c b/arch/arm64/kernel/probes/kprobes.c index aff80b342382..5619041ac74b 100644 --- a/arch/arm64/kernel/probes/kprobes.c +++ b/arch/arm64/kernel/probes/kprobes.c @@ -565,6 +565,11 @@ bool arch_within_kprobe_blacklist(unsigned long addr) return false; } +void __kprobes __used *trampoline_probe_handler(struct pt_regs *regs) +{ + return NULL; +} + int __init arch_init_kprobes(void) { return 0; |
