Re: [PATCH v2 0/2][next] Add STACK_FLEX_ARRAY_SIZE() helper

From: Kees Cook
Date: Wed Apr 30 2025 - 17:33:40 EST


On Tue, 22 Apr 2025 15:04:48 -0600, Gustavo A. R. Silva wrote:
> Add new STACK_FLEX_ARRAY_SIZE() helper to get the size of a
> flexible-array member defined using DEFINE_FLEX()/DEFINE_RAW_FLEX()
> at compile time.
>
> This is essentially the same as ARRAY_SIZE() but for on-stack
> flexible-array members.
>
> [...]

Applied to for-next/hardening, thanks!

[1/2] overflow: Add STACK_FLEX_ARRAY_SIZE() helper
https://git.kernel.org/kees/c/9cc4498acf3e
[2/2] kunit/overflow: Add tests for STACK_FLEX_ARRAY_SIZE() helper
https://git.kernel.org/kees/c/90961958f48f

Take care,

--
Kees Cook