diff options
| author | Kees Cook <[email protected]> | 2023-09-22 17:53:28 +0000 |
|---|---|---|
| committer | Andrew Morton <[email protected]> | 2023-10-18 21:34:12 +0000 |
| commit | b7c67206594a56be2407ae4da54a114c90609e53 (patch) | |
| tree | d0fa3b461cfd29f9c3b2f5ee508a953332931621 /tools/testing/radix-tree/linux.c | |
| parent | hugetlb: check for hugetlb folio before vmemmap_restore (diff) | |
| download | kernel-b7c67206594a56be2407ae4da54a114c90609e53.tar.gz kernel-b7c67206594a56be2407ae4da54a114c90609e53.zip | |
mm/memcg: annotate struct mem_cgroup_threshold_ary 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
mem_cgroup_threshold_ary.
[1] https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci
Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Kees Cook <[email protected]>
Acked-by: Shakeel Butt <[email protected]>
Acked-by: Roman Gushchin <[email protected]>
Reviewed-by: Gustavo A. R. Silva <[email protected]>
Acked-by: Michal Hocko <[email protected]>
Cc: Johannes Weiner <[email protected]>
Cc: "Matthew Wilcox (Oracle)" <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Diffstat (limited to 'tools/testing/radix-tree/linux.c')
0 files changed, 0 insertions, 0 deletions
