Skip to content

kprobes: Make KUnit and add stacktrace on kretprobe tests

Masami Hiramatsu linux-arm-kernel lkml 1 version In review

Get series with b4
b4 am 163369609308.636038.15295764725220907794.stgit@devnote2

Versions newest first

  1. v1 Latest8 patches 18 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/8kprobes: convert tests to kunitkernel/kprobes.c kernel/test_kprobes.c lib/Kconfig.debug+61 -1670 replies
2/8kprobes: Add a test case for stacktrace from kretprobe handlerarch/Kconfig arch/x86/Kconfig kernel/test_kprobes.c+167 -00 replies
3/8arm64: kprobes: Record frame pointer with kretprobe instancearch/arm64/kernel/probes/kprobes.c+2 -27 replies
4/8arm64: kprobes: Make a frame pointer on __kretprobe_trampolinearch/arm64/kernel/probes/kprobes_trampoline.S+4 -01 reply
5/8arm64: Recover kretprobe modified return address in stacktracearch/arm64/Kconfig arch/arm64/include/asm/stacktrace.h arch/arm64/kernel/stacktrace.c+6 -04 replies
6/8ARM: clang: Do not relay on lr register for stacktracearch/arm/kernel/stacktrace.c+1 -25 replies
7/8ARM: kprobes: Make a frame pointer on __kretprobe_trampolinearch/arm/probes/kprobes/core.c+24 -51 reply
8/8ARM: Recover kretprobe modified return address in stacktracearch/arm/Kconfig arch/arm/include/asm/stacktrace.h arch/arm/kernel/return_address.c +1 more+16 -00 replies

Reviews trailers per patch

5 of 8 patches have a Reviewed-by or Acked-by.

PatchMasami HiramatsuNick DesaulniersWill DeaconMark Rutland
1/8A-b
2/8
3/8A-b A-b
4/8A-b
5/8
6/8T-b R-b
7/8R-b
8/8

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 4 reviewers.

Read the v1 thread

Cover letter [PATCH 0/8] kprobes: Make KUnit and add stacktrace on kretprobe tests

Hi,

Here is the series to change the kprobes selftest to KUnit and add testcases for stacktrace on kretprobes, which has been fixed recently on x86.

KUnit conversion work has been done by Sven. (Thanks!)
I found that if there are testcases for the stacktrace on kretprobes we can make sure that the stacktrace can work or not while booting. So I added 2 additinal Kunit test cases for stacktrace on kretprobe. One is for a simple stacktrace on kretprobe, the other is for the stacktrace with kretprobes on nested functions.

But actually, this is currently only for the x86. Thus I also added some fixes to enable stacktrace on kretprobe on arm and arm64.

Note that for the arm, this series only supports framepointer based stacktrace. To support ARM unwinder, will need more work.

Thank you,

---

Masami Hiramatsu (7):
kprobes: Add a test case for stacktrace from kretprobe handler
arm64: kprobes: Record frame pointer with kretprobe instance
arm64: kprobes: Make a frame pointer on __kretprobe_trampoline
arm64: Recover kretprobe modified return address in stacktrace
ARM: clang: Do not relay on lr register for stacktrace
ARM: kprobes: Make a frame pointer on __kretprobe_trampoline
ARM: Recover kretprobe modified return address in stacktrace

Sven Schnelle (1):
kprobes: convert tests to kunit

 arch/Kconfig                                  |    8 +
 arch/arm/Kconfig                              |    1 
 arch/arm/include/asm/stacktrace.h             |    5 
 arch/arm/kernel/return_address.c              |    2 
 arch/arm/kernel/stacktrace.c                  |   11 +
 arch/arm/probes/kprobes/core.c                |   29 ++
 arch/arm64/Kconfig                            |    1 
 arch/arm64/include/asm/stacktrace.h           |    2 
 arch/arm64/kernel/probes/kprobes.c            |    4 
 arch/arm64/kernel/probes/kprobes_trampoline.S |    4 
 arch/arm64/kernel/stacktrace.c                |    3 
 arch/x86/Kconfig                              |    1 
 kernel/kprobes.c                              |    3 
 kernel/test_kprobes.c                         |  374 ++++++++++++++-----------
 lib/Kconfig.debug                             |    3 
 15 files changed, 278 insertions(+), 173 deletions(-)

--
Masami Hiramatsu (Linaro) <[email protected]>