diff options
author | Kees Cook <[email protected]> | 2023-08-17 13:42:15 -0700 |
---|---|---|
committer | Georgi Djakov <[email protected]> | 2023-08-22 01:11:32 +0300 |
commit | dd4904f3b924b489a0adbd88768fadaadab94156 (patch) | |
tree | fd5a94f9251f017d82a5de1ba1c93ab9d9f58801 /scripts/generate_rust_analyzer.py | |
parent | 6f0c60f1461181c4edcd916a9647145e9d5cff98 (diff) |
interconnect: qcom: Annotate struct icc_onecell_data with __counted_by
Prepare for the coming implementation by GCC and Clang of the __counted_by
attribute. Flexible array members annotated with __counted_by can have
their accesses bounds-checked at run-time checking via CONFIG_UBSAN_BOUNDS
(for array indexing) and CONFIG_FORTIFY_SOURCE (for strcpy/memcpy-family
functions).
As found with Coccinelle[1], add __counted_by for struct icc_onecell_data.
Additionally, since the element count member must be set before accessing
the annotated flexible array member, move its initialization earlier.
[1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci
Cc: Andy Gross <[email protected]>
Cc: Bjorn Andersson <[email protected]>
Cc: Konrad Dybcio <[email protected]>
Cc: Georgi Djakov <[email protected]>
Cc: [email protected]
Cc: [email protected]
Signed-off-by: Kees Cook <[email protected]>
Reviewed-by: Gustavo A. R. Silva <[email protected]>
Acked-by: Konrad Dybcio <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Georgi Djakov <[email protected]>
Diffstat (limited to 'scripts/generate_rust_analyzer.py')
0 files changed, 0 insertions, 0 deletions