> diff --git a/Documentation/bpf/kfuncs.rst b/Documentation/bpf/kfuncs.rst
> index 75e6c078e0e7..3a9db1108b95 100644
> --- a/Documentation/bpf/kfuncs.rst
> +++ b/Documentation/bpf/kfuncs.rst

[ ... ]

> diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
> index 8dd79b735a69..f3cf8d85bea0 100644
> --- a/kernel/bpf/verifier.c
> +++ b/kernel/bpf/verifier.c

[ ... ]

> @@ -12244,6 +12249,13 @@ static int check_kfunc_args(struct bpf_verifier_env 
> *env, struct bpf_kfunc_call_
>                       return ret;
>               break;
>       case KF_ARG_PTR_TO_LIST_NODE:
> +             if (is_kfunc_arg_nonown_allowed(btf, &args[i]) &&
> +                 type_is_non_owning_ref(reg->type) && !reg->ref_obj_id) {
> +                     /* Allow bpf_list_front/back return value for
> +                      * __nonown_allowed list-node arguments.
> +                      */
> +                     goto check_ok;
> +             }
>               if (reg->type != (PTR_TO_BTF_ID | MEM_ALLOC)) {
>                       verbose(env, "%s expected pointer to allocated 
> object\n",
>                               reg_arg_name(env, argno));
>  @@ -12253,6 +12265,7 @@ static int check_kfunc_args(struct bpf_verifier_env 
> *env, struct bpf_kfunc_call_
>                       verbose(env, "allocated object must be referenced\n");
>                       return -EINVAL;
>               }
> +check_ok:
>               ret = process_kf_arg_ptr_to_list_node(env, reg, argno, meta);
>               if (ret < 0)
>                       return ret;

This isn't a bug, but the multi-line comment doesn't match the BPF
subsystem style. The BPF guide requires multi-line comments to have the
opening /* on its own line for files under kernel/bpf/. Should this be:

  /*
   * Allow bpf_list_front/back return value for
   * __nonown_allowed list-node arguments.
   */

Eduard Zingerman raised a related nit in v10 RESEND: the check
'!reg->ref_obj_id' appears redundant. Would type_is_non_owning_ref() be
sufficient here?

Reference: 
https://lore.kernel.org/bpf/[email protected]/


---
AI reviewed your patch. Please fix the bug or email reply why it's not a bug.
See: https://github.com/kernel-patches/vmtest/blob/master/ci/claude/README.md

CI run summary: https://github.com/kernel-patches/bpf/actions/runs/26204125015

Reply via email to