]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
overflow: Introduce __DEFINE_FLEX for having no initializer
authorKees Cook <kees@kernel.org>
Fri, 30 May 2025 19:06:47 +0000 (12:06 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 19 Jun 2025 13:32:37 +0000 (15:32 +0200)
commitab20b0bdb01fc3e65ff6273893c94013f3e8a0e5
tree9d5a491737ec598c16076c7daa15bc409a244898
parent5ed1d7a7000002464bc1939f2b476752eaa2f155
overflow: Introduce __DEFINE_FLEX for having no initializer

commit 5c78e793f78732b60276401f75cc1a101f9ad121 upstream.

While not yet in the tree, there is a proposed patch[1] that was
depending on the prior behavior of _DEFINE_FLEX, which did not have an
explicit initializer. Provide this via __DEFINE_FLEX now, which can also
have attributes applied (e.g. __uninitialized).

Examples of the resulting initializer behaviors can be seen here:
https://godbolt.org/z/P7Go8Tr33

Link: https://lore.kernel.org/netdev/20250520205920.2134829-9-anthony.l.nguyen@intel.com
Fixes: 47e36ed78406 ("overflow: Fix direct struct member initialization in _DEFINE_FLEX()")
Signed-off-by: Kees Cook <kees@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
include/linux/overflow.h