Commit dacbfc16 authored by Thorsten Blum's avatar Thorsten Blum Committed by Kees Cook
Browse files

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: default avatarSimon Horman <horms@kernel.org>
Signed-off-by: default avatarThorsten Blum <thorsten.blum@linux.dev>
Link: https://patch.msgid.link/20260105122402.2685-2-thorsten.blum@linux.dev


Signed-off-by: default avatarKees Cook <kees@kernel.org>
parent 1d1fd188
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -42,7 +42,7 @@ struct sockaddr_alg_new {

struct af_alg_iv {
	__u32	ivlen;
	__u8	iv[];
	__u8	iv[] __counted_by(ivlen);
};

/* Socket options */