On Wed, Nov 15, 2023 at 9:18 PM Eduard Zingerman <eddyz87@xxxxxxxxx> wrote: > > Callbacks are similar to open coded iterators, so add imprecise > widening logic for callback body processing. This makes callback based > loops behave identically to open coded iterators, e.g. allowing to > verify programs like below: > > struct ctx { u32 i; }; > int cb(u32 idx, struct ctx* ctx) > { > ++ctx->i; > return 0; > } > ... > struct ctx ctx = { .i = 0 }; > bpf_loop(100, cb, &ctx, 0); > ... > > Signed-off-by: Eduard Zingerman <eddyz87@xxxxxxxxx> > --- > kernel/bpf/verifier.c | 24 ++++++++++++++++++++++-- > 1 file changed, 22 insertions(+), 2 deletions(-) > Acked-by: Andrii Nakryiko <andrii@xxxxxxxxxx> [...]