diff options
| author | Kees Cook <[email protected]> | 2023-10-03 16:29:52 -0700 |
|---|---|---|
| committer | Alex Deucher <[email protected]> | 2023-10-05 17:59:35 -0400 |
| commit | c8e7df374ba2ce715ed7f3ceba34efdbfffcb0a9 (patch) | |
| tree | 9292d2f7c73a1cea7111adaba095d71b25e28874 /tools/perf/scripts/python/bin/stackcollapse-record | |
| parent | e0a3e7bf62dfbf6a1730f244b2adf53fac07003b (diff) | |
drm/amdgpu: Annotate struct amdgpu_bo_list 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 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 amdgpu_bo_list.
Additionally, since the element count member must be set before accessing
the annotated flexible array member, move its initialization earlier.
Cc: Alex Deucher <[email protected]>
Cc: "Christian König" <[email protected]>
Cc: "Pan, Xinhui" <[email protected]>
Cc: David Airlie <[email protected]>
Cc: Daniel Vetter <[email protected]>
Cc: "Gustavo A. R. Silva" <[email protected]>
Cc: Luben Tuikov <[email protected]>
Cc: Christophe JAILLET <[email protected]>
Cc: Felix Kuehling <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Link: https://github.com/kees/kernel-tools/blob/trunk/coccinelle/examples/counted_by.cocci [1]
Reviewed-by: Luben Tuikov <[email protected]>
Reviewed-by: Christian König <[email protected]>
Signed-off-by: Kees Cook <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/bin/stackcollapse-record')
0 files changed, 0 insertions, 0 deletions