linux/samples/ftrace
Peter Zijlstra ee3e2469b3 x86/ftrace: Make it call depth tracking aware
Since ftrace has trampolines, don't use thunks for the __fentry__ site
but instead require that every function called from there includes
accounting. This very much includes all the direct-call functions.

Additionally, ftrace uses ROP tricks in two places:

 - return_to_handler(), and
 - ftrace_regs_caller() when pt_regs->orig_ax is set by a direct-call.

return_to_handler() already uses a retpoline to replace an
indirect-jump to defeat IBT, since this is a jump-type retpoline, make
sure there is no accounting done and ALTERNATIVE the RET into a ret.

ftrace_regs_caller() does much the same and gets the same treatment.

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lore.kernel.org/r/20220915111148.927545073@infradead.org
2022-10-17 16:41:19 +02:00
..
ftrace-direct-modify.c x86/ftrace: Make it call depth tracking aware 2022-10-17 16:41:19 +02:00
ftrace-direct-multi-modify.c x86/ftrace: Make it call depth tracking aware 2022-10-17 16:41:19 +02:00
ftrace-direct-multi.c x86/ftrace: Make it call depth tracking aware 2022-10-17 16:41:19 +02:00
ftrace-direct-too.c x86/ftrace: Make it call depth tracking aware 2022-10-17 16:41:19 +02:00
ftrace-direct.c x86/ftrace: Make it call depth tracking aware 2022-10-17 16:41:19 +02:00
Makefile ftrace/samples: Add module to test multi direct modify interface 2021-12-09 13:02:44 -05:00
sample-trace-array.c sample-trace-array: Remove trace_array 'sample-instance' 2020-06-16 21:21:02 -04:00
sample-trace-array.h tracing: Sample module to demonstrate kernel access to Ftrace instances. 2019-11-22 19:41:08 -05:00