Re: [PATCH] bpf: Fix signedness bug

From: Ethan Tidmore

Date: Fri Jun 05 2026 - 23:31:39 EST


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:

u32 i, nargs, ptr_type_id, id;

--
Thanks,
ET
https://github.com/sponsors/ethantidmore