On Thu, 2025-09-11 at 14:58 +0000, Puranjay Mohan wrote: > 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@xxxxxxxxxx> > --- Acked-by: Eduard Zingerman <eddyz87@xxxxxxxxx> [...] > @@ -120,6 +120,7 @@ struct bpf_prog *bpf_prog_alloc_no_stats(unsigned int size, gfp_t gfp_extra_flag > > fp->pages = size / PAGE_SIZE; > fp->aux = aux; > + fp->aux->main_prog_aux = aux; The fact that this needs to be added both here and in jit_subprogs is unfortunate :( [...]