Skip to content

Commit 97f3880

Browse files
tititiou36kees
authored andcommitted
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>
1 parent da2e08d commit 97f3880

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/misc/vmw_vmci/vmci_handle_array.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ struct vmci_handle_arr {
1717
u32 max_capacity;
1818
u32 size;
1919
u32 pad;
20-
struct vmci_handle entries[];
20+
struct vmci_handle entries[] __counted_by(capacity);
2121
};
2222

2323
#define VMCI_HANDLE_ARRAY_HEADER_SIZE \

0 commit comments

Comments
 (0)