Re: [PATCH] bpf: Fix signedness bug

From: Amery Hung

Date: Fri Jun 05 2026 - 23:50:35 EST


On Fri, Jun 5, 2026 at 8:31 PM Ethan Tidmore <ethantidmore06@xxxxxxxxx> wrote:
>
> On Fri Jun 5, 2026 at 10:25 PM CDT, bot+bpf-ci wrote:
> >> commit cc27f12c12ff54b8eace339c3e130317bf205277
> >> Author: Ethan Tidmore <ethantidmore06@xxxxxxxxx>
> >>
> >> bpf: Fix signedness bug
> >>
> >> The function acquire_reference() returns negative error codes and 'id'
> >> is an unsigned integer, so the check (id < 0) is always impossible.
> >
> > Is this commit message accurate? Looking at check_kfunc_call() in
> > kernel/bpf/verifier.c, the variable 'id' is declared as a signed int:
> >
> > const struct btf_param *args;
> > u32 i, nargs, ptr_type_id;
> > struct btf *desc_btf;
> > int id;
>
> No, 'id' is assigned as a u32:

You might want to pull bpf-next and check again then.

>
> u32 i, nargs, ptr_type_id, id;
>
> --
> Thanks,
> ET
> https://github.com/sponsors/ethantidmore