OpenCloudOS-Kernel/drivers/video/fbdev/mmp
Kees Cook 053d7dcd34 fbdev: mmp: Annotate struct mmphw_ctrl 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 mmphw_ctrl.

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

Cc: Helge Deller <deller@gmx.de>
Cc: linux-fbdev@vger.kernel.org
Cc: dri-devel@lists.freedesktop.org
Signed-off-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Signed-off-by: Helge Deller <deller@gmx.de>
2023-09-23 20:35:14 +02:00
..
fb fbdev/mmpfb: Use fbdev I/O helpers 2023-08-04 15:54:36 +02:00
hw fbdev: mmp: Annotate struct mmphw_ctrl with __counted_by 2023-09-23 20:35:14 +02:00
panel treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 13 2019-05-21 11:28:45 +02:00
Kconfig video: fbdev: mmp: add COMPILE_TEST support 2020-01-03 14:27:35 +01:00
Makefile treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
core.c video: fbdev: mmp: replace usage of found with dedicated list iterator variable 2022-04-12 22:06:10 +02:00