diff options
author | Christophe JAILLET <christophe.jaillet@wanadoo.fr> | 2023-10-07 17:32:34 +0300 |
---|---|---|
committer | Kees Cook <keescook@chromium.org> | 2023-12-01 20:51:43 +0300 |
commit | 97f3880a33cd4a0c916242fd296aed975ad512d3 (patch) | |
tree | c3efecbe9b3ad225c359503610ba8c631b4bb7ed /drivers/misc/vmw_vmci | |
parent | da2e08d4630ab04ee5b61515fe423c582b5c3be2 (diff) | |
download | linux-97f3880a33cd4a0c916242fd296aed975ad512d3.tar.xz |
VMCI: Annotate struct vmci_handle_arr 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).
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: Kees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/56bef519d982218176b59bbba64a3a308d8733d5.1696689091.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Kees Cook <keescook@chromium.org>
Diffstat (limited to 'drivers/misc/vmw_vmci')
-rw-r--r-- | drivers/misc/vmw_vmci/vmci_handle_array.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/misc/vmw_vmci/vmci_handle_array.h b/drivers/misc/vmw_vmci/vmci_handle_array.h index 96193f85be5b..b0e6b1956014 100644 --- a/drivers/misc/vmw_vmci/vmci_handle_array.h +++ b/drivers/misc/vmw_vmci/vmci_handle_array.h @@ -17,7 +17,7 @@ struct vmci_handle_arr { u32 max_capacity; u32 size; u32 pad; - struct vmci_handle entries[]; + struct vmci_handle entries[] __counted_by(capacity); }; #define VMCI_HANDLE_ARRAY_HEADER_SIZE \ |