public inbox for bpf@vger.kernel.org
 help / color / mirror / Atom feed
From: "Emil Tsalapatis" <emil@etsalapatis.com>
To: <bot+bpf-ci@kernel.org>, <emil@etsalapatis.com>, <bpf@vger.kernel.org>
Cc: <ast@kernel.org>, <andrii@kernel.org>, <memxor@gmail.com>,
	<daniel@iogearbox.net>, <eddyz87@gmail.com>, <etsal@meta.com>,
	<martin.lau@kernel.org>, <yonghong.song@linux.dev>,
	<clm@meta.com>, <ihor.solodrai@linux.dev>
Subject: Re: [PATCH bpf-next v3 1/9] bpf: Upgrade scalar to PTR_TO_ARENA on arena pointer addition
Date: Fri, 03 Apr 2026 14:07:45 -0400	[thread overview]
Message-ID: <DHJPXVNL60NO.1RIVY1CBVEB9P@etsalapatis.com> (raw)
In-Reply-To: <deb90258dc2746693419d66c4dda30b686a35434bdb8c1b85a6e6df059ccf4ae@mail.kernel.org>

On Fri Apr 3, 2026 at 1:04 AM EDT, bot+bpf-ci wrote:
>> diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
>> index a431b7d50e1b..a0e6522833ae 100644
>> --- a/kernel/bpf/verifier.c
>> +++ b/kernel/bpf/verifier.c
>> @@ -16354,6 +16354,24 @@ static int adjust_reg_min_max_vals(struct bpf_verifier_env *env,
>>  				return -EACCES;
>>  			} else {
>> +				/*
>> +				 * The compiler sometimes stores the result of
>> +				 * PTR_TO_ARENA + SCALAR addition to the scalar
>> +				 * register. Upgrade it to a PTR_TO_ARENA.
>> +				 */
>> +				if (src_reg->type == PTR_TO_ARENA && opcode == BPF_ADD) {
>> +					struct bpf_insn_aux_data *aux = cur_aux(env);
>> +
>> +					__mark_reg_unknown(env, dst_reg);
>> +					dst_reg->type = PTR_TO_ARENA;
>> +					dst_reg->subreg_def = env->insn_idx + 1;
>> +
>> +					if (BPF_CLASS(insn->code) == BPF_ALU64)
>> +						aux->needs_zext = true;
>> +
>> +					return 0;
>> +				}
>
> This appears to fix a gap in the original PTR_TO_ARENA support added by
> commit 6082b6c328b5 ("bpf: Recognize addr_space_cast instruction in the
> verifier."), which handled arithmetic when the destination was already
> PTR_TO_ARENA but missed the commutative case where the scalar register
> is the destination.
>
> Should this carry a Fixes: tag?
>
> Fixes: 6082b6c328b5 ("bpf: Recognize addr_space_cast instruction in the verifier.")
>
Ack, I will add the tag in subsequent versions.

>
> ---
> 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/23934176047


  reply	other threads:[~2026-04-03 18:07 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-03  4:27 [PATCH bpf-next v3 0/9] Introduce arena library and runtime Emil Tsalapatis
2026-04-03  4:27 ` [PATCH bpf-next v3 1/9] bpf: Upgrade scalar to PTR_TO_ARENA on arena pointer addition Emil Tsalapatis
2026-04-03  5:04   ` bot+bpf-ci
2026-04-03 18:07     ` Emil Tsalapatis [this message]
2026-04-03 18:42   ` Song Liu
2026-04-03 20:24   ` Alexei Starovoitov
2026-04-04 18:24     ` Emil Tsalapatis
2026-04-03  4:27 ` [PATCH bpf-next v3 2/9] selftests/bpf: Add test for scalar/arena " Emil Tsalapatis
2026-04-03 18:43   ` Song Liu
2026-04-03 20:25   ` Alexei Starovoitov
2026-04-04 19:00     ` Emil Tsalapatis
2026-04-04 20:01       ` Alexei Starovoitov
2026-04-03  4:27 ` [PATCH bpf-next v3 3/9] selftests/bpf: Move bpf_arena_spin_lock.h to the top level Emil Tsalapatis
2026-04-03 18:44   ` Song Liu
2026-04-03  4:27 ` [PATCH bpf-next v3 4/9] selftests/bpf: Deduplicate WRITE_ONCE macro between headers Emil Tsalapatis
2026-04-03 18:44   ` Song Liu
2026-04-03  4:27 ` [PATCH bpf-next v3 5/9] selftests/bpf: Add basic libarena scaffolding Emil Tsalapatis
2026-04-03  4:27 ` [PATCH bpf-next v3 6/9] selftests/bpf: Add arena ASAN runtime to libarena Emil Tsalapatis
2026-04-03  4:27 ` [PATCH bpf-next v3 7/9] selftests/bpf: Add ASAN support for libarena selftests Emil Tsalapatis
2026-04-03  4:27 ` [PATCH bpf-next v3 8/9] selftests/bpf: Add buddy allocator for libarena Emil Tsalapatis
2026-04-03  4:27 ` [PATCH bpf-next v3 9/9] selftests/bpf: Add selftests for libarena buddy allocator Emil Tsalapatis

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=DHJPXVNL60NO.1RIVY1CBVEB9P@etsalapatis.com \
    --to=emil@etsalapatis.com \
    --cc=andrii@kernel.org \
    --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=etsal@meta.com \
    --cc=ihor.solodrai@linux.dev \
    --cc=martin.lau@kernel.org \
    --cc=memxor@gmail.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