History log of /linux-6.15/lib/tests/overflow_kunit.c (Results 1 – 2 of 2)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: v6.15, v6.15-rc7, v6.15-rc6, v6.15-rc5, v6.15-rc4, v6.15-rc3, v6.15-rc2, v6.15-rc1, v6.14, v6.14-rc7, v6.14-rc6
# 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 ...


Revision tags: v6.14-rc5, v6.14-rc4, v6.14-rc3, v6.14-rc2, v6.14-rc1, v6.13, v6.13-rc7, v6.13-rc6, v6.13-rc5, v6.13-rc4, v6.13-rc3, v6.13-rc2
# 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 ...