diff options
| author | Kees Cook <[email protected]> | 2023-09-15 20:15:10 +0000 |
|---|---|---|
| committer | David S. Miller <[email protected]> | 2023-09-18 09:39:29 +0000 |
| commit | 1cb6422ecac8804ebe0b71f4b3440674955fec73 (patch) | |
| tree | 902d1dc409b3fb18eab1fff0885f9b6fe0c84731 /tools/testing/selftests/bpf/prog_tests/exceptions.c | |
| parent | net: spider_net: Use size_add() in call to struct_size() (diff) | |
| download | kernel-1cb6422ecac8804ebe0b71f4b3440674955fec73.tar.gz kernel-1cb6422ecac8804ebe0b71f4b3440674955fec73.zip | |
ceph: Annotate struct ceph_monmap 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 ceph_monmap.
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: Ilya Dryomov <[email protected]>
Cc: Xiubo Li <[email protected]>
Cc: Jeff Layton <[email protected]>
Cc: "David S. Miller" <[email protected]>
Cc: Eric Dumazet <[email protected]>
Cc: Jakub Kicinski <[email protected]>
Cc: Paolo Abeni <[email protected]>
Cc: [email protected]
Cc: [email protected]
Signed-off-by: Kees Cook <[email protected]>
Reviewed-by: Gustavo A. R. Silva <[email protected]>
Reviewed-by: Xiubo Li <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
Diffstat (limited to 'tools/testing/selftests/bpf/prog_tests/exceptions.c')
0 files changed, 0 insertions, 0 deletions
