Re: [PATCH bpf-next v1 03/14] bpf: Preserve R0 lineage across helper calls
Eduard Zingerman <[email protected]>
| Newsgroups | org.kernel.vger.bpf |
|---|---|
| Message-ID | <[email protected]> |
On Sun, 2026-08-16 at 03:57 +0200, Kumar Kartikeya Dwivedi wrote: > check_helper_call() clears all caller-saved registers before taking the > diagnostic snapshot of R0. This records NOT_INIT as the old state for every > helper return and loses the lineage of the value held in R0 before the call. > bpf_diag_record_caller_saved() deliberately skips R0 because the paired > modification scope is responsible for it. > > Open the R0 modification scope before clearing caller-saved registers, > matching the kfunc, ld_abs, and subprogram call paths. > > Reported-by: Sashiko <[email protected]> > Link: https://lore.kernel.org/bpf/[email protected]/ > Link: https://lore.kernel.org/bpf/48e6f021b89562f68850fe21ef8c78719819b04cf9c4e4f50bc791937d37ace8@mail.kernel.org/ > Signed-off-by: Kumar Kartikeya Dwivedi <[email protected]> > --- Acked-by: Eduard Zingerman <[email protected]>