Skip to content

Commit dacbfc1

Browse files
tobluxkees
authored andcommitted
crypto: af_alg - Annotate struct af_alg_iv with __counted_by
Add the __counted_by() compiler attribute to the flexible array member 'iv' to improve access bounds-checking via CONFIG_UBSAN_BOUNDS and CONFIG_FORTIFY_SOURCE. Reviewed-by: Simon Horman <horms@kernel.org> Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev> Link: https://patch.msgid.link/20260105122402.2685-2-thorsten.blum@linux.dev Signed-off-by: Kees Cook <kees@kernel.org>
1 parent 1d1fd18 commit dacbfc1

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

include/uapi/linux/if_alg.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ struct sockaddr_alg_new {
4242

4343
struct af_alg_iv {
4444
__u32 ivlen;
45-
__u8 iv[];
45+
__u8 iv[] __counted_by(ivlen);
4646
};
4747

4848
/* Socket options */

0 commit comments

Comments
 (0)