Skip to contentSkip to conversation

uprobe: gate bpf call behind BPF_EVENTS

PATCH Applied Delyan Kratunov 3 participants 3 messages Jun 20, 2022 – Jun 21, 2022

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 uprobe: gate bpf call behind BPF_EVENTS

The call into bpf from uprobes needs to be gated now that it doesn't use the trace_events.h helpers.

Randy found this as a randconfig build failure on linux-next [1].

[1]: https://lore.kernel.org/linux-next/[email protected]/

---
 kernel/trace/trace_uprobe.c | 2 ++
 1 file changed, 2 insertions(+)
kernel/trace/trace_uprobe.c +2 -0
index 0282c119b1b2..326235fd2346 100644
@@ -1344,6 +1344,7 @@ static void __uprobe_perf_func(struct trace_uprobe *tu,
 	int size, esize;
 	int rctx;
 
+#ifdef CONFIG_BPF_EVENTS
 	if (bpf_prog_array_valid(call)) {
 		u32 ret;
 
@@ -1351,6 +1352,7 @@ static void __uprobe_perf_func(struct trace_uprobe *tu,
 		if (!ret)
 			return;
 	}
+#endif /* CONFIG_BPF_EVENTS */
 
 	esize = SIZEOF_TRACE_ENTRY(is_ret_probe(tu));
 

--
2.36.1

Tested-by Acked-by on v1 1/1
#1 lore raw
Quoted 9 lines · Delyan Kratunov

The call into bpf from uprobes needs to be gated now that it doesn't use the trace_events.h helpers.

Randy found this as a randconfig build failure on linux-next [1].

[1]: https://lore.kernel.org/linux-next/[email protected]/

Thanks.

Quoted 26 lines
---
 kernel/trace/trace_uprobe.c | 2 ++
 1 file changed, 2 insertions(+)
kernel/trace/trace_uprobe.c +2 -1
index 0282c119b1b2..326235fd2346 100644
@@ -1344,6 +1344,7 @@ static void __uprobe_perf_func(struct trace_uprobe *tu,
 	int size, esize;
 	int rctx;
 
+#ifdef CONFIG_BPF_EVENTS
 	if (bpf_prog_array_valid(call)) {
 		u32 ret;
 
@@ -1351,6 +1352,7 @@ static void __uprobe_perf_func(struct trace_uprobe *tu,
 		if (!ret)
 			return;
 	}
+#endif /* CONFIG_BPF_EVENTS */
 
 	esize = SIZEOF_TRACE_ENTRY(is_ret_probe(tu));
 
--

2.36.1

Signature · 1 line
~Randy
#2 lore raw
In reply to Delyan Kratunov
This patch was applied to bpf/bpf-next.git (master) by Alexei Starovoitov <[email protected]>:

Hello:

This patch was applied to bpf/bpf-next.git (master) by Alexei Starovoitov <[email protected]>:

Quoted 8 lines · On Mon, 20 Jun 2022 21:47:55 +0000 you wrote:

The call into bpf from uprobes needs to be gated now that it doesn't use the trace_events.h helpers.

Randy found this as a randconfig build failure on linux-next [1].

[1]: https://lore.kernel.org/linux-next/[email protected]/

[...]

Here is the summary with links:
- [bpf-next] uprobe: gate bpf call behind BPF_EVENTS

    https://git.kernel.org/bpf/bpf-next/c/aca80dd95e20

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html