Home
last modified time | relevance | path

Searched hist:"157 c56a4fedecb0f91a96a138a5cd8954d00541f" (Results 1 – 1 of 1) sorted by relevance

/linux/drivers/net/ethernet/chelsio/cxgb4/
H A Dcxgb4_tc_u32_parse.hdiff 157c56a4fedecb0f91a96a138a5cd8954d00541f Fri Sep 29 20:11:47 CEST 2023 Kees Cook <keescook@chromium.org> cxgb4: Annotate struct cxgb4_tc_u32_table 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 cxgb4_tc_u32_table.

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

Cc: Raju Rangoju <rajur@chelsio.com>
Signed-off-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Link: https://lore.kernel.org/r/20230929181149.3006432-3-keescook@chromium.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>