[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5832065e-d998-4dc7-9df9-9186d3d26d9b@embeddedor.com>
Date: Wed, 19 Jun 2024 09:27:28 -0600
From: "Gustavo A. R. Silva" <gustavo@...eddedor.com>
To: Nathan Chancellor <nathan@...nel.org>,
Javier Carrasco <javier.carrasco.cruz@...il.com>
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/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 <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?
+1 :)
Thanks
--
Gustavo
Powered by blists - more mailing lists