Merge branch 'batch-1-annotate-structs-with-__counted_by'
Kees Cook says: ==================== Batch 1: Annotate structs with __counted_by This is the batch 1 of patches touching netdev for preparing 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 to structs that would benefit from the annotation. Since the element count member must be set before accessing the annotated flexible array member, some patches also move the member's initialization earlier. (These are noted in the individual patches.) [1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci ==================== Link: https://lore.kernel.org/r/20230922172449.work.906-kees@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Please register or sign in to comment