Skip to content
Commit 9dd5134c authored by Kees Cook's avatar Kees Cook
Browse files

kunit/overflow: Adjust for __counted_by with DEFINE_RAW_FLEX()



When a flexible array structure has a __counted_by annotation, its use
with DEFINE_RAW_FLEX() will result in the count being zero-initialized.
This is expected since one doesn't want to use RAW with a counted_by
struct. Adjust the tests to check for the condition and for compiler
support.

Reported-by: default avatarChristian Schrefl <chrisi.schrefl@gmail.com>
Closes: https://lore.kernel.org/all/0bfc6b38-8bc5-4971-b6fb-dc642a73fbfe@gmail.com/


Suggested-by: default avatarNathan Chancellor <nathan@kernel.org>
Reviewed-by: default avatarNathan Chancellor <nathan@kernel.org>
Link: https://lore.kernel.org/r/20240610182301.work.272-kees@kernel.org


Tested-by: default avatarChristian Schrefl <chrisi.schrefl@gmail.com>
Reviewed-by: default avatarChristian Schrefl <chrisi.schrefl@gmail.com>
Signed-off-by: default avatarKees Cook <kees@kernel.org>
parent f7d3b1ff
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment