On 5/22/26 5:41 AM, Himanshu Anand wrote:
> Signed-off-by: Himanshu Anand <anand.himanshu17@gmail.com>
Looks like patch subject and commit message are messed up. Please
fix it in the next revision.
Please use [PATCH bpf v2] as the tag.
> ---
> kernel/bpf/btf.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/kernel/bpf/btf.c b/kernel/bpf/btf.c
> index a62d78581207..b767a9fcf095 100644
> --- a/kernel/bpf/btf.c
> +++ b/kernel/bpf/btf.c
> @@ -3765,7 +3765,8 @@ static int btf_find_field_one(const struct btf *btf,
> */
> for (i = 0; i < MAX_RESOLVE_DEPTH && btf_type_is_array(var_type); i++) {
> array = btf_array(var_type);
> - nelems *= array->nelems;
> + if (check_mul_overflow(nelems, array->nelems, &nelems))
> + return -E2BIG;
Looks correct to me.
> var_type = btf_type_by_id(btf, array->type);
> }
> if (i == MAX_RESOLVE_DEPTH)