Skip to contentSkip to conversation

crypto: af_alg - Annotate struct af_alg_iv with __counted_by

PATCH Superseded Thorsten Blum 2 participants 2 messages Nov 14, 2025 – Nov 21, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 include/uapi/linux/if_alg.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
include/uapi/linux/if_alg.h +1 -1
index b35871cbeed7..4f51e198ac2e 100644
@@ -42,7 +42,7 @@ struct sockaddr_alg_new {
 
 struct af_alg_iv {
 	__u32	ivlen;
-	__u8	iv[];
+	__u8	iv[] __counted_by(ivlen);
 };
 
 /* Socket options */
Signature · 1 line
2.51.1