Re: [PATCH] bpf: Annotate struct bpf_cand_cache with __counted_by()

2024-08-14 Thread Alexei Starovoitov
On Tue, Aug 13, 2024 at 1:51 PM Thorsten Blum wrote: > > On 13. Aug 2024, at 20:57, Alexei Starovoitov > wrote: > > On Tue, Aug 13, 2024 at 10:59 AM Thorsten Blum > > wrote: > >> On 13. Aug 2024, at 18:28, Alexei Starovoitov > >> wrote: > >>

Re: [PATCH] bpf: Annotate struct bpf_cand_cache with __counted_by()

2024-08-13 Thread Alexei Starovoitov
On Tue, Aug 13, 2024 at 10:59 AM Thorsten Blum wrote: > > On 13. Aug 2024, at 18:28, Alexei Starovoitov > wrote: > > On Tue, Aug 13, 2024 at 8:19 AM Thorsten Blum > > wrote: > >> > >> Add the __counted_by compiler attribute to the flexible array mem

Re: [PATCH] bpf: Annotate struct bpf_cand_cache with __counted_by()

2024-08-13 Thread Alexei Starovoitov
On Tue, Aug 13, 2024 at 8:19 AM Thorsten Blum wrote: > > Add the __counted_by compiler attribute to the flexible array member > cands to improve access bounds-checking via CONFIG_UBSAN_BOUNDS and > CONFIG_FORTIFY_SOURCE. > > Increment cnt before adding a new struct to the cands array. why? What h