From: Yonghong Song <yonghong.song@linux.dev>
To: bpf@vger.kernel.org
Subject: Re: [PATCH bpf-next v2 1/4] libbpf: Zero-extend unsigned 32-bit enum values in CO-RE relocations
Date: Thu, 19 Nov 2026 07:55:16 -0800 [thread overview]
Message-ID: <4ee1f1de-ae9e-42b6-b7a8-b0e37633b51f@linux.dev> (raw)
In-Reply-To: <d711aef177c86b8b225bdf52e9b0a47894d8ec2f2b5432010c78f3a275501d43@mail.kernel.org>
On 11/18/26 9:54 PM, bot+bpf-ci@kernel.org wrote:
>> libbpf: Zero-extend unsigned 32-bit enum values in CO-RE relocations
> TL;DR: Commit message only: the Fixes tag may be wrong, since the
> sign-extending enum read predates 23b2a3a8f63a and was introduced by
> eacaaed784e2; the tag may need to change.
>
>> libbpf: Zero-extend unsigned 32-bit enum values in CO-RE relocations
>>
>> [ ... ]
>>
>> Fixes: 23b2a3a8f63a ("libbpf: Add enum64 relocation support")
>> Signed-off-by: Yonghong Song <yonghong.song@linux.dev>
> The sign-extending read of btf_enum->val in bpf_core_calc_enumval_relo()
> predates 23b2a3a8f63a, which only wrapped the existing read in an
> if (btf_is_enum(t)) branch. The old code already had the same __s32 to
> u64 sign extension:
>
> e = btf_enum(t) + idx;
> *val = e->val;
>
> The sign-extending read was introduced by eacaaed784e2 ("libbpf: Implement
> enum value-based CO-RE relocations"). Should the tag be:
>
> Fixes: eacaaed784e2 ("libbpf: Implement enum value-based CO-RE relocations")
>
> The unsigned-enum (kflag) distinction was added later, so the unsigned
> symptom could arguably be dated to that, but the faulty read itself comes
> from eacaaed784e2.
I don't think we should use the following:
Fixes: eacaaed784e2 ("libbpf: Implement enum value-based CO-RE relocations")
This commit is dated back to 2020:
commit eacaaed784e2c9da69dea3030c81062c1fd66a37
Author: Andrii Nakryiko <andriin@fb.com>
Date: Wed Aug 19 12:45:18 2020 -0700
libbpf: Implement enum value-based CO-RE relocations
and I don't think this can be backported due to in between a lot of changes.
I will choose this one:
Fixes: 776281652ddc ("libbpf: Permit 64bit relocation value")
commit 776281652ddcd98bb292335ea3634da341c849b4
Author: Yonghong Song <yhs@fb.com>
Date: Mon Jun 6 23:26:05 2022 -0700
libbpf: Permit 64bit relocation value
This commits allows 64bit relocation value and this is directly related
to this patch set.
>
>
> ---
> 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/44465301903
next prev parent reply other threads:[~2026-11-19 15:55 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-19 5:14 [PATCH bpf-next v2 0/4] libbpf: Fix CO-RE relocations of unsigned 32-bit enum values Yonghong Song
2026-11-19 5:14 ` [PATCH bpf-next v2 1/4] libbpf: Zero-extend unsigned 32-bit enum values in CO-RE relocations Yonghong Song
2026-11-19 5:54 ` bot+bpf-ci
2026-11-19 15:55 ` Yonghong Song [this message]
2026-11-19 5:14 ` [PATCH bpf-next v2 2/4] selftests/bpf: Test CO-RE relocations of unsigned 32-bit enum values Yonghong Song
2026-11-19 5:54 ` bot+bpf-ci
2026-11-19 15:57 ` Yonghong Song
2026-11-19 5:14 ` [PATCH bpf-next v2 3/4] libbpf: Accept sign-extended 32-bit enum values in CO-RE relocations Yonghong Song
2026-11-19 5:21 ` sashiko-bot
2026-11-19 5:15 ` [PATCH bpf-next v2 4/4] selftests/bpf: Take unsigned enum values as unsigned int for GCC Yonghong Song
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=4ee1f1de-ae9e-42b6-b7a8-b0e37633b51f@linux.dev \
--to=yonghong.song@linux.dev \
--cc=bpf@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.