Thread (3 messages) 3 messages, 2 authors, 2026-04-20

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

From: Alan Maguire <hidden>
Date: 2026-04-20 16:07:13
Also in: bpf

On 20/04/2026 16:39, Alexei Starovoitov wrote:
On Mon Apr 20, 2026 at 1:02 AM PDT, Alan Maguire wrote:
quoted
-       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?
I think it's good to go; I'll send an official bpf-targeted patch for the above with Fixes: tag.
Thanks!
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help