The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH bpf-next 0/2] bpf: Fix WARNING in bpf_trampoline_multi_detach
@ 2026-07-10 14:47 Leon Hwang
  2026-07-10 14:47 ` [PATCH bpf-next 1/2] bpf: Mark tracing_multi trampolines as ftrace managed Leon Hwang
  2026-07-10 14:47 ` [PATCH bpf-next 2/2] selftests/bpf: Test fentry link after tracing_multi link Leon Hwang
  0 siblings, 2 replies; 5+ messages in thread
From: Leon Hwang @ 2026-07-10 14:47 UTC (permalink / raw)
  To: bpf
  Cc: Alexei Starovoitov, Daniel Borkmann, John Fastabend,
	Andrii Nakryiko, Eduard Zingerman, Kumar Kartikeya Dwivedi,
	Martin KaFai Lau, Song Liu, Yonghong Song, Jiri Olsa,
	Emil Tsalapatis, Shuah Khan, Leon Hwang, linux-kernel,
	linux-kselftest, kernel-patches-bot

Since tracing_multi link does not set ftrace_managed, it would fail to
release the tracing_multi link when attaching tracing_multi link and
then attaching fentry link.

[    3.714215] WARNING: kernel/bpf/trampoline.c:1727 at bpf_trampoline_multi_detach+0x20b/0x240, CPU#1: test_progs/97
...
[    3.733170]  bpf_tracing_multi_link_release+0x14/0x30
[    3.733890]  bpf_link_free+0x58/0x130
[    3.734414]  bpf_link_release+0x23/0x30

Fix it by setting 'ftrace_managed = true' in register_fentry_multi().

Note: the reason of targeting bpf-next tree is I'm planning to add
tracing_multi link support for bpf progs, that would rely on the fix and
have code conflict with the test.

Leon Hwang (2):
  bpf: Mark tracing_multi trampolines as ftrace managed
  selftests/bpf: Test fentry link after tracing_multi link

 kernel/bpf/trampoline.c                       |  1 +
 .../selftests/bpf/prog_tests/tracing_multi.c  | 69 +++++++++++++++++++
 .../progs/tracing_multi_intersect_attach.c    |  8 +++
 3 files changed, 78 insertions(+)

-- 
2.55.0


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

end of thread, other threads:[~2026-07-11 12:09 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-10 14:47 [PATCH bpf-next 0/2] bpf: Fix WARNING in bpf_trampoline_multi_detach Leon Hwang
2026-07-10 14:47 ` [PATCH bpf-next 1/2] bpf: Mark tracing_multi trampolines as ftrace managed Leon Hwang
2026-07-10 22:15   ` Jiri Olsa
2026-07-11 12:09     ` Leon Hwang
2026-07-10 14:47 ` [PATCH bpf-next 2/2] selftests/bpf: Test fentry link after tracing_multi link Leon Hwang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox