]> Gentwo Git Trees - linux/.git/commit
bpf: core: introduce main_prog_aux for stream access
authorPuranjay Mohan <puranjay@kernel.org>
Thu, 11 Sep 2025 14:58:01 +0000 (14:58 +0000)
committerAlexei Starovoitov <ast@kernel.org>
Thu, 11 Sep 2025 20:00:43 +0000 (13:00 -0700)
commit70f23546d246563da648baedbb0432ba1d6bb357
treefcbf3179be03afa2d03bf20200f7ee48b9f37e0d
parent0460484244e1fa4a0cdbc9ed76c838fc528134d3
bpf: core: introduce main_prog_aux for stream access

BPF streams are only valid for the main programs, to make it easier to
access streams from subprogs, introduce main_prog_aux in struct
bpf_prog_aux.

prog->aux->main_prog_aux = prog->aux, for main programs and
prog->aux->main_prog_aux = main_prog->aux, for subprograms.

Make bpf_prog_find_from_stack() use the added main_prog_aux to return
the mainprog when a subprog is found on the stack.

Signed-off-by: Puranjay Mohan <puranjay@kernel.org>
Acked-by: Eduard Zingerman <eddyz87@gmail.com>
Link: https://lore.kernel.org/r/20250911145808.58042-3-puranjay@kernel.org
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
include/linux/bpf.h
kernel/bpf/core.c
kernel/bpf/verifier.c