public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Gustavo A. R. Silva" <gustavo@embeddedor.com>
To: Javier Carrasco <javier.carrasco.cruz@gmail.com>,
	Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	Kees Cook <kees@kernel.org>,
	"Gustavo A. R. Silva" <gustavoars@kernel.org>
Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-hardening@vger.kernel.org
Subject: Re: [PATCH 1/2] Input: ims-pcu - annotate struct ims_pcu_flash_fmt with __counted_by
Date: Wed, 19 Jun 2024 15:26:51 -0600	[thread overview]
Message-ID: <26028fee-8043-4f81-a062-bbff12f4c904@embeddedor.com> (raw)
In-Reply-To: <20240619-ims-pcu-counted_by-v1-1-3ee0ead2e57d@gmail.com>



On 19/06/24 23:13, 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@gmail.com>

Reviewed-by: Gustavo A. R. Silva <gustavoars@kernel.org>

Thanks
-- 
Gustavo

> ---
>   drivers/input/misc/ims-pcu.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/input/misc/ims-pcu.c b/drivers/input/misc/ims-pcu.c
> index 408a586f8c36..91f8ad826238 100644
> --- a/drivers/input/misc/ims-pcu.c
> +++ b/drivers/input/misc/ims-pcu.c
> @@ -761,7 +761,7 @@ static int ims_pcu_switch_to_bootloader(struct ims_pcu *pcu)
>   struct ims_pcu_flash_fmt {
>   	__le32 addr;
>   	u8 len;
> -	u8 data[];
> +	u8 data[] __counted_by(len);
>   };
>   
>   static unsigned int ims_pcu_count_fw_records(const struct firmware *fw)
> 

  parent reply	other threads:[~2024-06-19 21:26 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-19 21:13 [PATCH 0/2] Input: ims-pcu - annotate struct ims_pcu_flash_fmt with __counted_by Javier Carrasco
2024-06-19 21:13 ` [PATCH 1/2] " Javier Carrasco
2024-06-19 21:19   ` Kees Cook
2024-06-19 21:26   ` Gustavo A. R. Silva [this message]
2024-06-20 21:57   ` Dmitry Torokhov
2024-06-19 21:13 ` [PATCH 2/2] Input: ims-pcu - drop repeated "input" in error message Javier Carrasco
2024-06-19 21:19   ` Kees Cook
2024-06-20 21:58   ` Dmitry Torokhov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=26028fee-8043-4f81-a062-bbff12f4c904@embeddedor.com \
    --to=gustavo@embeddedor.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=gustavoars@kernel.org \
    --cc=javier.carrasco.cruz@gmail.com \
    --cc=kees@kernel.org \
    --cc=linux-hardening@vger.kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox