summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorAlexei Starovoitov <ast@kernel.org>2019-12-08 16:01:12 -0800
committerSteven Rostedt (VMware) <rostedt@goodmis.org>2019-12-10 13:53:59 -0500
commitff205766dbbee024a4a716638868d98ffb17748a (patch)
tree503d0cfaaecf515dd179e6e0c6a8c0ef57f2b3cb /arch
parenta61f810567be0ef101d8bbb65b89ffeac7d62103 (diff)
ftrace: Fix function_graph tracer interaction with BPF trampoline
Depending on type of BPF programs served by BPF trampoline it can call original function. In such case the trampoline will skip one stack frame while returning. That will confuse function_graph tracer and will cause crashes with bad RIP. Teach graph tracer to skip functions that have BPF trampoline attached. Signed-off-by: Alexei Starovoitov <ast@kernel.org> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/kernel/ftrace.c14
1 files changed, 0 insertions, 14 deletions
diff --git a/arch/x86/kernel/ftrace.c b/arch/x86/kernel/ftrace.c
index 060a361d9d11..024c3053dbba 100644
--- a/arch/x86/kernel/ftrace.c
+++ b/arch/x86/kernel/ftrace.c
@@ -1043,20 +1043,6 @@ void prepare_ftrace_return(unsigned long self_addr, unsigned long *parent,
return;
/*
- * If the return location is actually pointing directly to
- * the start of a direct trampoline (if we trace the trampoline
- * it will still be offset by MCOUNT_INSN_SIZE), then the
- * return address is actually off by one word, and we
- * need to adjust for that.
- */
- if (ftrace_direct_func_count) {
- if (ftrace_find_direct_func(self_addr + MCOUNT_INSN_SIZE)) {
- self_addr = *parent;
- parent++;
- }
- }
-
- /*
* Protect against fault, even if it shouldn't
* happen. This tool is too much intrusive to
* ignore such a protection.