Commit 9dd5134
committed
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: Christian Schrefl <[email protected]>
Closes: https://lore.kernel.org/all/[email protected]/
Suggested-by: Nathan Chancellor <[email protected]>
Reviewed-by: Nathan Chancellor <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Tested-by: Christian Schrefl <[email protected]>
Reviewed-by: Christian Schrefl <[email protected]>
Signed-off-by: Kees Cook <[email protected]>1 parent f7d3b1f commit 9dd5134
1 file changed
+17
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1178 | 1178 | | |
1179 | 1179 | | |
1180 | 1180 | | |
| 1181 | + | |
| 1182 | + | |
| 1183 | + | |
| 1184 | + | |
| 1185 | + | |
| 1186 | + | |
1181 | 1187 | | |
1182 | 1188 | | |
1183 | | - | |
| 1189 | + | |
| 1190 | + | |
| 1191 | + | |
| 1192 | + | |
| 1193 | + | |
| 1194 | + | |
| 1195 | + | |
| 1196 | + | |
| 1197 | + | |
1184 | 1198 | | |
1185 | 1199 | | |
1186 | 1200 | | |
1187 | | - | |
1188 | | - | |
| 1201 | + | |
| 1202 | + | |
1189 | 1203 | | |
1190 | 1204 | | |
1191 | 1205 | | |
| |||
0 commit comments