Re: [PATCH bpf-next v4 10/16] bpf: Report Resource Lifetime reference leaks

Eduard Zingerman <[email protected]>
Newsgroups org.kernel.vger.bpf
Message-ID <[email protected]>
On Thu, 2026-08-13 at 01:33 +0200, Kumar Kartikeya Dwivedi wrote:
> Augment selected Resource Lifetime Safety failures with structured diagnostics
> while preserving the existing verifier messages.
> 
> Report unreleased references from check_reference_leak() using
> reference-scoped diagnostic history, and add state reports for dynptr,
> iterator, lock, and IRQ-flag lifetime misuse.
> 
> IRQ restore mismatch and out-of-order diagnostics use IRQ context-scoped
> history when an IRQ-disabled region is active, so retained save/restore context
> is still visible after per-state history removal.
> 
> Signed-off-by: Kumar Kartikeya Dwivedi <[email protected]>
> ---

Acked-by: Eduard Zingerman <[email protected]>

...

> diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
> index 080c6b893fb0..24ae3cb38f6d 100644
> --- a/kernel/bpf/verifier.c
> +++ b/kernel/bpf/verifier.c

...

> @@ -7136,11 +7158,13 @@ enum {
>   * env->cur_state->active_locks remembers which map value element or allocated
>   * object got locked and clears it after bpf_spin_unlock.
>   */
> -static int process_spin_lock(struct bpf_verifier_env *env, struct bpf_reg_state *reg, argno_t argno, int flags)
> +static int process_spin_lock(struct bpf_verifier_env *env, struct bpf_reg_state *reg, argno_t argno,
> +			     int flags)

Nit: churn.

...
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.