linux-stable/arch
Masami Hiramatsu 1f6d3a8f5e kprobes: Add a test case for stacktrace from kretprobe handler
Add a test case for stacktrace from kretprobe handler and
nested kretprobe handlers.

This test checks both of stack trace inside kretprobe handler
and stack trace from pt_regs. Those stack trace must include
actual function return address instead of kretprobe trampoline.
The nested kretprobe stacktrace test checks whether the unwinder
can correctly unwind the call frame on the stack which has been
modified by the kretprobe.

Since the stacktrace on kretprobe is correctly fixed only on x86,
this introduces a meta kconfig ARCH_CORRECT_STACKTRACE_ON_KRETPROBE
which tells user that the stacktrace on kretprobe is correct or not.

The test results will be shown like below;

 TAP version 14
 1..1
     # Subtest: kprobes_test
     1..6
     ok 1 - test_kprobe
     ok 2 - test_kprobes
     ok 3 - test_kretprobe
     ok 4 - test_kretprobes
     ok 5 - test_stacktrace_on_kretprobe
     ok 6 - test_stacktrace_on_nested_kretprobe
 # kprobes_test: pass:6 fail:0 skip:0 total:6
 # Totals: pass:6 fail:0 skip:0 total:6
 ok 1 - kprobes_test

Link: https://lkml.kernel.org/r/163516211244.604541.18350507860972214415.stgit@devnote2

Signed-off-by: Masami Hiramatsu <mhiramat@kernel.org>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
2021-10-26 17:23:45 -04:00
..
alpha alpha: enable GENERIC_PCI_IOMAP unconditionally 2021-09-19 10:37:00 -07:00
arc ARC: Add instruction_pointer_set() API 2021-09-30 21:24:07 -04:00
arm ARM: Recover kretprobe modified return address in stacktrace 2021-10-22 12:16:53 -04:00
arm64 arm64: Recover kretprobe modified return address in stacktrace 2021-10-22 12:16:53 -04:00
csky ftrace: Cleanup ftrace_dyn_arch_init() 2021-10-08 19:41:39 -04:00
h8300 Merge branch 'akpm' (patches from Andrew) 2021-09-08 12:55:35 -07:00
hexagon Merge branch 'akpm' (patches from Andrew) 2021-09-08 12:55:35 -07:00
ia64 ftrace: Cleanup ftrace_dyn_arch_init() 2021-10-08 19:41:39 -04:00
m68k m68k: mvme: Remove overdue #warnings in RTC handling 2021-09-13 11:19:05 +02:00
microblaze ftrace: Cleanup ftrace_dyn_arch_init() 2021-10-08 19:41:39 -04:00
mips kprobes: treewide: Make it harder to refer kretprobe_trampoline directly 2021-09-30 21:24:06 -04:00
nds32 ftrace: Cleanup ftrace_dyn_arch_init() 2021-10-08 19:41:39 -04:00
nios2 Merge branch 'akpm' (patches from Andrew) 2021-09-08 12:55:35 -07:00
openrisc Merge branch 'akpm' (patches from Andrew) 2021-09-08 12:55:35 -07:00
parisc ftrace: Cleanup ftrace_dyn_arch_init() 2021-10-08 19:41:39 -04:00
powerpc kprobes: treewide: Make it harder to refer kretprobe_trampoline directly 2021-09-30 21:24:06 -04:00
riscv ftrace: Cleanup ftrace_dyn_arch_init() 2021-10-08 19:41:39 -04:00
s390 ftrace: Cleanup ftrace_dyn_arch_init() 2021-10-08 19:41:39 -04:00
sh ftrace/sh: Add arch_ftrace_ops_list_func stub to have compressed image still link 2021-10-26 17:23:36 -04:00
sparc ftrace: Cleanup ftrace_dyn_arch_init() 2021-10-08 19:41:39 -04:00
um This pull request contains the following changes for UML: 2021-09-09 13:45:26 -07:00
x86 kprobes: Add a test case for stacktrace from kretprobe handler 2021-10-26 17:23:45 -04:00
xtensa Tracing updates for 5.15: 2021-09-05 11:50:41 -07:00
.gitignore
Kconfig kprobes: Add a test case for stacktrace from kretprobe handler 2021-10-26 17:23:45 -04:00