Re: [PATCH bpf-next v4 13/13] bpf: Reject tracing progs for struct_ops with arena args

Eduard Zingerman <[email protected]>
Newsgroups org.kernel.vger.bpf
Message-ID <[email protected]>
On Wed, 2026-08-05 at 23:04 +0200, Kumar Kartikeya Dwivedi wrote:

...

> diff --git a/kernel/bpf/trampoline.c b/kernel/bpf/trampoline.c
> index b349e0817184..e07af35ed040 100644
> --- a/kernel/bpf/trampoline.c
> +++ b/kernel/bpf/trampoline.c
> @@ -529,16 +529,6 @@ bpf_trampoline_get_progs(const struct bpf_trampoline *tr, int *total, bool *ip_a
>  	return tnodes;
>  }
>  
> -static bool bpf_prog_has_arena_ctx_arg(const struct bpf_prog *prog)
> -{
> -	int i;
> -
> -	for (i = 0; i < prog->aux->ctx_arg_info_size; i++)
> -		if (base_type(prog->aux->ctx_arg_info[i].reg_type) == PTR_TO_ARENA)
> -			return true;
> -	return false;
> -}

Let's pick one place for this function throughout the series and don't
move it.

Also, a selftest?

...
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.