On Fri, 2024-05-03 at 11:02 -0700, Kui-Feng Lee wrote: [...] > > > @@ -3624,9 +3690,14 @@ static int btf_find_datasec_var(const struct btf *btf, const struct btf_type *t, > > > > > > if (ret == BTF_FIELD_IGNORE) > > > continue; > > > - if (idx >= info_cnt) > > > + if (idx + nelems > info_cnt) > > > return -E2BIG; > > > > Nit: This is bounded by BTF_FIELDS_MAX which has value of 11, > > would that be enough? > > So far, no one has complained it yet! > But, some one will reach the limit in future. > If people want a flexible length, I will solve it in a follow-up. > WDYT? Sure, follow-up works. Just that 11 is not much for an array. I think sched_ext is the only user for this feature at the moment, so you are in the best position to judge which size is appropriate.