linux-stable/drivers/memstick/host
Kees Cook 45492b1345 memstick: jmb38x_ms: Annotate struct jmb38x_ms with __counted_by
Prepare for the coming implementation by GCC and Clang of the __counted_by
attribute. Flexible array members annotated with __counted_by can have
their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS
(for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family
functions).

As found with Coccinelle[1], add __counted_by for struct jmb38x_ms.

[1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci

Cc: Maxim Levitsky <maximlevitsky@gmail.com>
Cc: Alex Dubov <oakad@yahoo.com>
Cc: Ulf Hansson <ulf.hansson@linaro.org>
Cc: Tom Rix <trix@redhat.com>
Cc: Len Baker <len.baker@gmx.com>
Cc: Dan Carpenter <error27@gmail.com>
Cc: "Gustavo A. R. Silva" <gustavoars@kernel.org>
Cc: linux-mmc@vger.kernel.org
Signed-off-by: Kees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/20230922175249.work.593-kees@kernel.org
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
2023-09-27 12:13:18 +02:00
..
Kconfig memstick: Fix Kconfig indentation 2019-11-21 12:25:59 +01:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
jmb38x_ms.c memstick: jmb38x_ms: Annotate struct jmb38x_ms with __counted_by 2023-09-27 12:13:18 +02:00
r592.c memstick r592: make memstick_debug_get_tpc_name() static 2023-06-12 15:16:19 +02:00
r592.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500 2019-06-19 17:09:55 +02:00
rtsx_pci_ms.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 17 2019-05-21 11:28:46 +02:00
rtsx_usb_ms.c memstick: rtsx_usb_ms: fix UAF 2021-06-14 13:57:39 +02:00
tifm_ms.c memstick: switch from 'pci_' to 'dma_' API 2021-08-24 16:59:39 +02:00