Re: [PATCH v2] Compiler Attributes: Add __counted_by macro

From: Kees Cook
Date: Fri May 26 2023 - 13:16:52 EST


On Wed, 17 May 2023 12:08:44 -0700, Kees Cook wrote:
> In an effort to annotate all flexible array members with their run-time
> size information, the "element_count" attribute is being introduced by
> Clang[1] and GCC[2] in future releases. This annotation will provide
> the CONFIG_UBSAN_BOUNDS and CONFIG_FORTIFY_SOURCE features the ability
> to perform run-time bounds checking on otherwise unknown-size flexible
> arrays.
>
> [...]

FYI, applied to for-next/hardening:

[1/1] Compiler Attributes: Add __counted_by macro
https://git.kernel.org/kees/c/86a76e91cbab

--
Kees Cook