[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <4c74c145-4fc1-44b9-88e7-1075c541adba@gmail.com>
Date: Wed, 19 Jun 2024 18:12:01 +0200
From: Javier Carrasco <javier.carrasco.cruz@...il.com>
To: Nathan Chancellor <nathan@...nel.org>
Cc: Johan Hovold <johan@...nel.org>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>, Kees Cook
<kees@...nel.org>, "Gustavo A. R. Silva" <gustavoars@...nel.org>,
Nick Desaulniers <ndesaulniers@...gle.com>, Bill Wendling
<morbo@...gle.com>, Justin Stitt <justinstitt@...gle.com>,
linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-hardening@...r.kernel.org, llvm@...ts.linux.dev
Subject: Re: [PATCH] USB: serial: garmin_gps: annotate struct garmin_packet
with __counted_by
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 <javier.carrasco.cruz@...il.com>
>> ---
>> The size is assigned before the first reference to the flexible array
>> (see pkt_add()), which allows for a straightforward annotation without
>> further modifications.
>
> Agreed, this seems like a reasonable patch in and of itself that should
> work:
>
> Reviewed-by: Nathan Chancellor <nathan@...nel.org>
>
> It might also make sense to change the pkt allocation to use
> struct_size() instead of open coding it?
Sure, it looks much better. I will send a v2 with the patch and the
corresponding Suggested-by:
Thanks and best regards,
Javier Carrasco
Powered by blists - more mailing lists