Alexander Lobakin ca7e324e8a compiler_types: add Endianness-dependent __counted_by_{le,be}
Some structures contain flexible arrays at the end and the counter for
them, but the counter has explicit Endianness and thus __counted_by()
can't be used directly.

To increase test coverage for potential problems without breaking
anything, introduce __counted_by_{le,be}() defined depending on
platform's Endianness to either __counted_by() when applicable or noop
otherwise.
Maybe it would be a good idea to introduce such attributes on compiler
level if possible, but for now let's stop on what we have.

Acked-by: Kees Cook <keescook@chromium.org>
Acked-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Signed-off-by: Alexander Lobakin <aleksander.lobakin@intel.com>
Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
Link: https://lore.kernel.org/r/20240327142241.1745989-2-aleksander.lobakin@intel.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2024-03-28 18:50:47 -07:00
..
2024-03-15 13:03:13 -07:00
2024-03-21 14:41:00 -07:00
2024-03-14 15:35:42 -07:00
2024-03-22 10:22:45 -07:00
2024-03-21 14:41:00 -07:00
2023-07-01 09:24:31 -07:00
2022-10-03 14:03:19 -07:00
2024-03-21 14:41:00 -07:00
2023-12-03 18:51:48 +09:00
2020-12-08 23:30:04 +09:00
2024-01-04 17:01:15 +01:00
2021-05-03 17:23:06 -06:00
2023-12-03 18:51:48 +09:00