Re: [PATCH] USB: serial: garmin_gps: annotate struct garmin_packet with __counted_by

2024-06-19 Thread Javier Carrasco
On 19/06/2024 16:43, Nathan Chancellor wrote: > On Wed, Jun 19, 2024 at 11:40:57AM +0200, Javier Carrasco wrote: >> Use the __counted_by compiler attribute for the data[] flexible array member >> to improve the results of array bound sanitizers. >> >> Signed-off-by: Javier Carrasco >> --- >> The s

Re: [PATCH] USB: serial: garmin_gps: annotate struct garmin_packet with __counted_by

2024-06-19 Thread Gustavo A. R. Silva
On 19/06/24 16:43, Nathan Chancellor wrote: On Wed, Jun 19, 2024 at 11:40:57AM +0200, Javier Carrasco wrote: Use the __counted_by compiler attribute for the data[] flexible array member to improve the results of array bound sanitizers. Signed-off-by: Javier Carrasco --- The size is assigned

Re: [PATCH] USB: serial: garmin_gps: annotate struct garmin_packet with __counted_by

2024-06-19 Thread Nathan Chancellor
On Wed, Jun 19, 2024 at 11:40:57AM +0200, Javier Carrasco wrote: > Use the __counted_by compiler attribute for the data[] flexible array member > to improve the results of array bound sanitizers. > > Signed-off-by: Javier Carrasco > --- > The size is assigned before the first reference to the fle

[PATCH] USB: serial: garmin_gps: annotate struct garmin_packet with __counted_by

2024-06-19 Thread Javier Carrasco
Use the __counted_by compiler attribute for the data[] flexible array member to improve the results of array bound sanitizers. Signed-off-by: Javier Carrasco --- The size is assigned before the first reference to the flexible array (see pkt_add()), which allows for a straightforward annotation wi