linux-trace-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH bpf-next 0/3] Fix ftrace for livepatch + BPF fexit programs
@ 2025-10-24  7:12 Song Liu
  2025-10-24  7:12 ` [PATCH bpf-next 1/3] ftrace: Fix BPF fexit with livepatch Song Liu
                   ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: Song Liu @ 2025-10-24  7:12 UTC (permalink / raw)
  To: bpf, linux-trace-kernel, live-patching
  Cc: ast, daniel, andrii, rostedt, andrey.grodzovsky, mhiramat,
	kernel-team, Song Liu

livepatch and BPF trampoline are two special users of ftrace. livepatch
uses ftrace with IPMODIFY flag and BPF trampoline uses ftrace direct
functions. When livepatch and BPF trampoline with fexit programs attach to
the same kernel function, BPF trampoline needs to call into the patched
version of the kernel function.

1/3 and 2/3 of this patchset fix two issues with livepatch + fexit cases,
one in the register_ftrace_direct path, the other in the
modify_ftrace_direct path.

3/3 adds selftests for both cases.

Song Liu (3):
  ftrace: Fix BPF fexit with livepatch
  ftrace: bpf: Fix IPMODIFY + DIRECT in modify_ftrace_direct()
  selftests/bpf: Add tests for livepatch + bpf trampoline

 kernel/bpf/trampoline.c                       |  12 ++-
 kernel/trace/ftrace.c                         |  14 ++-
 tools/testing/selftests/bpf/config            |   3 +
 .../bpf/prog_tests/livepatch_trampoline.c     | 101 ++++++++++++++++++
 .../bpf/progs/livepatch_trampoline.c          |  30 ++++++
 5 files changed, 153 insertions(+), 7 deletions(-)
 create mode 100644 tools/testing/selftests/bpf/prog_tests/livepatch_trampoline.c
 create mode 100644 tools/testing/selftests/bpf/progs/livepatch_trampoline.c

--
2.47.3

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2025-10-24 18:51 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-24  7:12 [PATCH bpf-next 0/3] Fix ftrace for livepatch + BPF fexit programs Song Liu
2025-10-24  7:12 ` [PATCH bpf-next 1/3] ftrace: Fix BPF fexit with livepatch Song Liu
2025-10-24 11:42   ` Jiri Olsa
2025-10-24 15:42     ` Song Liu
2025-10-24 18:51       ` Jiri Olsa
2025-10-24  7:12 ` [PATCH bpf-next 2/3] ftrace: bpf: Fix IPMODIFY + DIRECT in modify_ftrace_direct() Song Liu
2025-10-24 11:43   ` Jiri Olsa
2025-10-24 15:47     ` Song Liu
2025-10-24 16:21       ` Steven Rostedt
2025-10-24 17:03         ` Song Liu
2025-10-24  7:12 ` [PATCH bpf-next 3/3] selftests/bpf: Add tests for livepatch + bpf trampoline Song Liu
2025-10-24 16:42 ` [PATCH bpf-next 0/3] Fix ftrace for livepatch + BPF fexit programs Alexei Starovoitov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).