diff mbox series

[bpf-next] uprobe: gate bpf call behind BPF_EVENTS

Message ID cb8bfbbcde87ed5d811227a393ef4925f2aadb7b.camel@fb.com (mailing list archive)
State Accepted
Commit aca80dd95e20f1fa0daa212afc83c9fa0ad239e5
Delegated to: BPF
Headers show
Series [bpf-next] uprobe: gate bpf call behind BPF_EVENTS | expand

Checks

Context Check Description
netdev/tree_selection success Clearly marked for bpf-next
netdev/fixes_present success Fixes tag not required for -next series
netdev/subject_prefix success Link
netdev/cover_letter success Single patches do not need cover letters
netdev/patch_count success Link
netdev/header_inline success No static functions without inline keyword in header files
netdev/build_32bit success Errors and warnings before: 3 this patch: 3
netdev/cc_maintainers warning 7 maintainers not CCed: netdev@vger.kernel.org songliubraving@fb.com mingo@redhat.com yhs@fb.com john.fastabend@gmail.com kafai@fb.com kpsingh@kernel.org
netdev/build_clang success Errors and warnings before: 6 this patch: 6
netdev/module_param success Was 0 now: 0
netdev/verify_signedoff success Signed-off-by tag matches author and committer
netdev/check_selftest success No net selftest shell script
netdev/verify_fixes success No Fixes tag
netdev/build_allmodconfig_warn success Errors and warnings before: 3 this patch: 3
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 14 lines checked
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/source_inline success Was 0 now: 0
bpf/vmtest-bpf-next-VM_Test-3 success Logs for Kernel LATEST on z15 with gcc
bpf/vmtest-bpf-next-VM_Test-1 success Logs for Kernel LATEST on ubuntu-latest with gcc
bpf/vmtest-bpf-next-PR success PR summary
bpf/vmtest-bpf-next-VM_Test-2 success Logs for Kernel LATEST on ubuntu-latest with llvm-15

Commit Message

Delyan Kratunov June 20, 2022, 9:47 p.m. UTC
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/2de99180-7d55-2fdf-134d-33198c27cc58@infradead.org/

Reported-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Delyan Kratunov <delyank@fb.com>
---
 kernel/trace/trace_uprobe.c | 2 ++
 1 file changed, 2 insertions(+)

--
2.36.1

Comments

Randy Dunlap June 20, 2022, 9:58 p.m. UTC | #1
On 6/20/22 14:47, Delyan Kratunov 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/2de99180-7d55-2fdf-134d-33198c27cc58@infradead.org/
> 
> Reported-by: Randy Dunlap <rdunlap@infradead.org>
> Signed-off-by: Delyan Kratunov <delyank@fb.com>

Tested-by: Randy Dunlap <rdunlap@infradead.org>
Acked-by: Randy Dunlap <rdunlap@infradead.org>

Thanks.

> ---
>  kernel/trace/trace_uprobe.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/kernel/trace/trace_uprobe.c b/kernel/trace/trace_uprobe.c
> index 0282c119b1b2..326235fd2346 100644
> --- a/kernel/trace/trace_uprobe.c
> +++ b/kernel/trace/trace_uprobe.c
> @@ -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
patchwork-bot+netdevbpf@kernel.org June 21, 2022, 12:10 a.m. UTC | #2
Hello:

This patch was applied to bpf/bpf-next.git (master)
by Alexei Starovoitov <ast@kernel.org>:

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/2de99180-7d55-2fdf-134d-33198c27cc58@infradead.org/
> 
> [...]

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!
diff mbox series

Patch

diff --git a/kernel/trace/trace_uprobe.c b/kernel/trace/trace_uprobe.c
index 0282c119b1b2..326235fd2346 100644
--- a/kernel/trace/trace_uprobe.c
+++ b/kernel/trace/trace_uprobe.c
@@ -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));