diff options
author | Javier Carrasco <javier.carrasco.cruz@gmail.com> | 2024-06-19 23:13:21 +0200 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2024-06-20 08:45:12 -0700 |
commit | e8135f9dc774f956bca44a13cf056403140e2337 (patch) | |
tree | d7effb5dbde9e55ffa46cc88720d882d55afbb82 /drivers/input | |
parent | 9b9247397e2e20016031e59f76dae563b79b6ee2 (diff) | |
download | lwn-e8135f9dc774f956bca44a13cf056403140e2337.tar.gz lwn-e8135f9dc774f956bca44a13cf056403140e2337.zip |
Input: ims-pcu - annotate struct ims_pcu_flash_fmt with __counted_by
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: Kees Cook <kees@kernel.org>
Reviewed-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Link: https://lore.kernel.org/r/20240619-ims-pcu-counted_by-v1-1-3ee0ead2e57d@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Diffstat (limited to 'drivers/input')
-rw-r--r-- | drivers/input/misc/ims-pcu.c | 2 |
1 files changed, 1 insertions, 1 deletions
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) |