From: Anton Protopopov <a.s.protopopov@gmail.com>
To: bot+bpf-ci@kernel.org
Cc: bpf@vger.kernel.org, ast@kernel.org, daniel@iogearbox.net,
andrii@kernel.org, aspsk@isovalent.com,
syzbot+5a0f1995634f7c1dadbf@syzkaller.appspotmail.com,
martin.lau@kernel.org, eddyz87@gmail.com,
yonghong.song@linux.dev, clm@meta.com, ihor.solodrai@linux.dev
Subject: Re: [PATCH v2 bpf-next] bpf: Fix a potential use-after-free
Date: Mon, 9 Feb 2026 13:27:39 +0000 [thread overview]
Message-ID: <aYngy0xZohOKbUdE@mail.gmail.com> (raw)
In-Reply-To: <896dfc751c8e3c2b98b9b36b05bf75956640d3b9dca70d24d18eed82c4f662c7@mail.kernel.org>
On 26/02/09 01:06PM, bot+bpf-ci@kernel.org wrote:
> > diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
> > index edf5342b982f..24de90357450 100644
> > --- a/kernel/bpf/verifier.c
> > +++ b/kernel/bpf/verifier.c
> > @@ -21333,29 +21333,28 @@ static int find_btf_percpu_datasec(struct btf *btf)
> > }
> >
> > /*
> > - * Add btf to the used_btfs array and return the index. (If the btf was
> > - * already added, then just return the index.) Upon successful insertion
> > - * increase btf refcnt, and, if present, also refcount the corresponding
> > - * kernel module.
> > + * Add btf to the used_btfs array and return the index. If needed, refcount the
> > + * corresponding kernel module. To simplify caller's error checking in case of
> > + * error or if btf was added before, decrease the btf refcount.
> > */
>
> The updated comment says "return the index" but the function now returns 0
> on success rather than the actual index. The old code returned
> env->used_btf_cnt++ (the index), but the new code returns 0:
>
> env->used_btf_cnt++;
> return 0;
>
> Should the comment say "return 0 on success" instead of "return the index"?
Yeah, thanks
> [ ... ]
>
>
> ---
> 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/21825693233
>
> AI-authorship-score: low
> AI-authorship-explanation: The commit has standard kernel formatting, addresses a real syzbot-reported bug with proper attribution, and shows iterative development through review feedback, all consistent with human authorship.
> issues-found: 1
> issue-severity-score: low
> issue-severity-explanation: Minor documentation issue where a comment says 'return the index' but the function returns 0 on success; no runtime impact as no callers use the return value as an index.
prev parent reply other threads:[~2026-02-09 13:19 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-09 12:46 [PATCH v2 bpf-next] bpf: Fix a potential use-after-free Anton Protopopov
2026-02-09 13:06 ` bot+bpf-ci
2026-02-09 13:27 ` Anton Protopopov [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aYngy0xZohOKbUdE@mail.gmail.com \
--to=a.s.protopopov@gmail.com \
--cc=andrii@kernel.org \
--cc=aspsk@isovalent.com \
--cc=ast@kernel.org \
--cc=bot+bpf-ci@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=clm@meta.com \
--cc=daniel@iogearbox.net \
--cc=eddyz87@gmail.com \
--cc=ihor.solodrai@linux.dev \
--cc=martin.lau@kernel.org \
--cc=syzbot+5a0f1995634f7c1dadbf@syzkaller.appspotmail.com \
--cc=yonghong.song@linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox