From: Chris Mason <clm@meta.com>
To: Alexei Starovoitov <alexei.starovoitov@gmail.com>
Cc: bot+bpf-ci@kernel.org,
Anton Protopopov <a.s.protopopov@gmail.com>,
bpf <bpf@vger.kernel.org>, Alexei Starovoitov <ast@kernel.org>,
Andrii Nakryiko <andrii@kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>,
Martin KaFai Lau <martin.lau@kernel.org>,
Eduard <eddyz87@gmail.com>,
Yonghong Song <yonghong.song@linux.dev>,
Ihor Solodrai <ihor.solodrai@linux.dev>
Subject: Re: [PATCH bpf-next] bpf: cleanup aux->used_maps after jit
Date: Mon, 24 Nov 2025 12:40:59 -0500 [thread overview]
Message-ID: <a7db8a91-7345-4070-a8c1-7ceba6c14eda@meta.com> (raw)
In-Reply-To: <CAADnVQKObG_rRmXW1L+eOzwe5265Gtrz=MLfL+mh4UuiYN_NsA@mail.gmail.com>
On 11/24/25 11:55 AM, Alexei Starovoitov wrote:
> On Mon, Nov 24, 2025 at 7:56 AM Chris Mason <clm@meta.com> wrote:
>>
>> On 11/24/25 10:30 AM, bot+bpf-ci@kernel.org wrote:
>>>> diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
>>>> index 2e170be64..766695491 100644
>>>> --- a/kernel/bpf/verifier.c
>>>> +++ b/kernel/bpf/verifier.c
>>>> @@ -22266,6 +22266,15 @@ static int jit_subprogs(struct bpf_verifier_env *env)
>>>> cond_resched();
>>>> }
>>>>
>>>> + /*
>>>> + * Cleanup func[i]->aux fields which aren't required
>>>> + * or can become invalid in future
>>>> + */
>>>> + for (i = 0; i < env->subprog_cnt; i++) {
>>>> + func[i]->aux->used_maps = NULL;
>>>> + func[i]->aux->used_map_cnt = 0;
>>>> + }
>>>> +
>>>
>>> The patch correctly fixes the use-after-free issue. However, this isn't a
>>> bug, but should this have a Cc: stable@vger.kernel.org tag? The bug being
>>> fixed affects released kernels where bpf_prog_free_deferred() will call
>>> bpf_free_used_maps() on the dangling func[i]->aux->used_maps pointer,
>>> potentially causing kfree() to be called on already-freed or invalid memory.
>>
>> I took a pull request for the review prompts this morning that adds
>> Fixes: suggestions and verification. If Alexei or others here would
>> rather have this disabled for the BPF reviews, I'll make them default to
>> off.
>
> Disable it pls.
> In this case Fixes tag point to a commit in bpf-next,
> so nothing to backport and, in general, we pretty much
> never do "cc: stable" unless it's a critical fix.
> I believe Greg and Sasha don't rely on cc: stable much.
> Automation will figure things out based on Fixes tag.
> cc: stable is an additional signal, but not mandatory,
> and we prefer to avoid extra lines in the commit log when they
> are not necessary.
>
> Fixes tag is a different story. We definitely want it for fixes
> and related changes even when they're not necessarily a fix.
> But a generic AI comment "should there be a Fixes tag?" will not
> be useful. If it can say "Should there be Fixes: sha ("bpf: ..")"
> that would be nice.
Agreed, it shouldn't be hard for AI to suggest the Fixes: tag and the
commit being fixed. I'll work on this.
I've disabled the Fixes: prompt by default, looks like one more review
got in before I turned it off.
-chris
next prev parent reply other threads:[~2025-11-24 17:41 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-24 15:15 [PATCH bpf-next] bpf: cleanup aux->used_maps after jit Anton Protopopov
2025-11-24 15:30 ` bot+bpf-ci
2025-11-24 15:56 ` Chris Mason
2025-11-24 16:55 ` Alexei Starovoitov
2025-11-24 17:40 ` Chris Mason [this message]
2025-11-24 17:50 ` patchwork-bot+netdevbpf
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=a7db8a91-7345-4070-a8c1-7ceba6c14eda@meta.com \
--to=clm@meta.com \
--cc=a.s.protopopov@gmail.com \
--cc=alexei.starovoitov@gmail.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bot+bpf-ci@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=eddyz87@gmail.com \
--cc=ihor.solodrai@linux.dev \
--cc=martin.lau@kernel.org \
--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