summaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/ftrace_64.S
diff options
context:
space:
mode:
authorSteven Rostedt (VMware) <rostedt@goodmis.org>2020-04-22 12:25:42 -0400
committerSteven Rostedt (VMware) <rostedt@goodmis.org>2020-06-29 11:42:48 -0400
commitfe58acefd5a66d33a8fb94da53c3af4374b6d376 (patch)
treee00f659bf2156c567425f165d847357dda3c1442 /arch/x86/kernel/ftrace_64.S
parent5da7cd11d0811c35a6988d416053b5421bc61521 (diff)
downloadlinux-fe58acefd5a66d33a8fb94da53c3af4374b6d376.tar.bz2
x86/ftrace: Do not jump to direct code in created trampolines
When creating a trampoline based on the ftrace_regs_caller code, nop out the jnz test that would jmup to the code that would return to a direct caller (stored in the ORIG_RAX field) and not back to the function that called it. Link: http://lkml.kernel.org/r/20200422162750.638839749@goodmis.org Cc: Peter Zijlstra <peterz@infradead.org> Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Diffstat (limited to 'arch/x86/kernel/ftrace_64.S')
-rw-r--r--arch/x86/kernel/ftrace_64.S1
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/x86/kernel/ftrace_64.S b/arch/x86/kernel/ftrace_64.S
index 43cf9a2b52c7..ac3d5f22fe64 100644
--- a/arch/x86/kernel/ftrace_64.S
+++ b/arch/x86/kernel/ftrace_64.S
@@ -241,6 +241,7 @@ SYM_INNER_LABEL(ftrace_regs_call, SYM_L_GLOBAL)
*/
movq ORIG_RAX(%rsp), %rax
testq %rax, %rax
+SYM_INNER_LABEL(ftrace_regs_caller_jmp, SYM_L_GLOBAL)
jnz 1f
restore_mcount_regs