| #
04e403e6 |
| 04-Mar-2025 |
Kees Cook <[email protected]> |
kunit/overflow: Fix DEFINE_FLEX tests for counted_by
Unfortunately, __builtin_dynamic_object_size() does not take into account flexible array sizes, even when they are sized by __counted_by. As a re
kunit/overflow: Fix DEFINE_FLEX tests for counted_by
Unfortunately, __builtin_dynamic_object_size() does not take into account flexible array sizes, even when they are sized by __counted_by. As a result, the size tests for the flexible arrays need to be separated to get an accurate check of the compiler's behavior. While at it, fully test sizeof, __struct_size (bdos(..., 0)), and __member_size (bdos(..., 1)).
I still think this is a compiler design issue, but there's not much to be done about it currently beyond adjusting these tests. GCC and Clang agree on this behavior at least. :)
Reported-by: "Thomas Weißschuh" <[email protected]> Closes: https://lore.kernel.org/lkml/[email protected]/ Fixes: 9dd5134c6158 ("kunit/overflow: Adjust for __counted_by with DEFINE_RAW_FLEX()") Signed-off-by: Kees Cook <[email protected]>
show more ...
|
| #
db6fe4d6 |
| 02-Dec-2024 |
Kees Cook <[email protected]> |
lib: Move KUnit tests into tests/ subdirectory
Following from the recent KUnit file naming discussion[1], move all KUnit tests in lib/ into lib/tests/.
Link: https://lore.kernel.org/lkml/2024072016
lib: Move KUnit tests into tests/ subdirectory
Following from the recent KUnit file naming discussion[1], move all KUnit tests in lib/ into lib/tests/.
Link: https://lore.kernel.org/lkml/[email protected]/ [1] Acked-by: Steven Rostedt (Google) <[email protected]> Acked-by: Jakub Kicinski <[email protected]> Acked-by: Masami Hiramatsu (Google) <[email protected]> Reviewed-by: David Gow <[email protected]> Acked-by: Vlastimil Babka <[email protected]> Reviewed-by: Rae Moar <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Kees Cook <[email protected]>
show more ...
|