From: "Emil Tsalapatis" <emil@etsalapatis.com>
To: <bot+bpf-ci@kernel.org>, <bpf@vger.kernel.org>
Cc: <andrii@kernel.org>, <eddyz87@gmail.com>, <ast@kernel.org>,
<daniel@iogearbox.net>, <john.fastabend@gmail.com>,
<memxor@gmail.com>, <yonghong.song@linux.dev>,
<martin.lau@kernel.org>, <clm@meta.com>,
<ihor.solodrai@linux.dev>
Subject: Re: [PATCH v3 3/5] libbpf: turn relo_core->sym_off unsigned
Date: Mon, 15 Dec 2025 12:08:05 -0500 [thread overview]
Message-ID: <DEYYET8EY784.ZN1JWGL84JWG@etsalapatis.com> (raw)
In-Reply-To: <9ddeb4c102ee96af6b969ca2894438e94c20e6ac1781a25928b0a5a76ec8702b@mail.kernel.org>
On Mon Dec 15, 2025 at 11:37 AM EST, bot+bpf-ci wrote:
>> diff --git a/tools/lib/bpf/libbpf.c b/tools/lib/bpf/libbpf.c
>> index c7c79014d46c..5e66bbc2ab85 100644
>> --- a/tools/lib/bpf/libbpf.c
>> +++ b/tools/lib/bpf/libbpf.c
>> @@ -380,7 +380,7 @@ struct reloc_desc {
>> const struct bpf_core_relo *core_relo; /* used when type == RELO_CORE */
>> struct {
>> int map_idx;
>> - int sym_off;
>> + unsigned int sym_off;
>> /*
>> * The following two fields can be unionized, as the
>> * ext_idx field is used for extern symbols, and the
>> @@ -763,7 +763,7 @@ struct bpf_object {
>>
>> struct {
>> struct bpf_program *prog;
>> - int sym_off;
>> + unsigned int sym_off;
>> int fd;
>> } *jumptable_maps;
>> size_t jumptable_map_cnt;
>
> The field type change looks correct, but does create_jt_map() defeat
> the purpose of this patch? That function declares a local variable
> "int sym_off" that immediately converts the unsigned field back to
> signed. When sym_off is >= 2GiB (the exact scenario this patch enables),
> the local variable will interpret it as negative, causing incorrect
> behavior in the modulo check, bounds check, and pointer arithmetic that
> follow.
>
>
The jumptable relocations handled by create_jt_map() don't have their
symbol offset artificially inflated they way we do for symbols in the
arena section, so keeping the sym_off signed inside create_jt_map()
should not cause a problem. We should still change it to handle
sym_off consistently across the codebase.
> ---
> 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/20239524817
next prev parent reply other threads:[~2025-12-15 17:08 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-15 16:13 [PATCH v3 0/5] libbpf: move arena variables out of the zero page Emil Tsalapatis
2025-12-15 16:13 ` [PATCH v3 1/5] selftests/bpf: explicitly account for globals in verifier_arena_large Emil Tsalapatis
2025-12-15 16:13 ` [PATCH v3 2/5] bpf/verifier: do not limit maximum direct offset into arena map Emil Tsalapatis
2025-12-15 20:19 ` Eduard Zingerman
2025-12-16 17:25 ` Emil Tsalapatis
2025-12-16 20:13 ` Eduard Zingerman
2025-12-16 21:48 ` Emil Tsalapatis
2025-12-15 16:13 ` [PATCH v3 3/5] libbpf: turn relo_core->sym_off unsigned Emil Tsalapatis
2025-12-15 16:37 ` bot+bpf-ci
2025-12-15 17:08 ` Emil Tsalapatis [this message]
2025-12-15 20:05 ` Eduard Zingerman
2025-12-15 16:13 ` [PATCH v3 4/5] libbpf: move arena globals to the end of the arena Emil Tsalapatis
2025-12-15 21:12 ` Eduard Zingerman
2025-12-15 16:13 ` [PATCH v3 5/5] selftests/bpf: add tests for the arena offset of globals Emil Tsalapatis
2025-12-15 21:26 ` Eduard Zingerman
2025-12-16 2:28 ` 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=DEYYET8EY784.ZN1JWGL84JWG@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=ihor.solodrai@linux.dev \
--cc=john.fastabend@gmail.com \
--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