Re: [PATCH v3 bpf-next 2/6] libbpf: Adjust btf_vlen() to return a __u32

"Alexei Starovoitov" <[email protected]>
Newsgroups dev.linux.lists.sashiko,org.kernel.vger.bpf
Message-ID <[email protected]>
On Mon Apr 20, 2026 at 1:02 AM PDT, Alan Maguire wrote:
> -       return sizeof(struct btf_type) + l[kind].info_sz + vlen * l[kind].elem_sz;
> +       type_size = sizeof(struct btf_type) + l[kind].info_sz + vlen * l[kind].elem_sz;
> +       if ((size_t)type_size > (size_t)(end_type - (const void *)t)) {
> +               pr_debug("Overflow in type size %d for kind %u\n",
> +                        type_size, kind);
> +               return -EINVAL;
> +       }
> +       return type_size;
>  }
>
> Given that this problem exists separate from the extended vlen series, might make more
> sense to send a separate patch targeting the bpf tree for this issue.

Make sense to me. Use check_add_overflow() when you do.
Are you still planning to respin the set ? or is it good to go?
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.