From: Thorsten Blum Date: Thu, 23 Oct 2025 17:48:11 +0000 (+0200) Subject: keys: Annotate struct asymmetric_key_id with __counted_by X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=12ad5b2346f905a3962b4aee701191b7a8d1905a;p=thirdparty%2Flinux.git keys: Annotate struct asymmetric_key_id with __counted_by Add the __counted_by() compiler attribute to the flexible array member 'data' to improve access bounds-checking via CONFIG_UBSAN_BOUNDS and CONFIG_FORTIFY_SOURCE. Signed-off-by: Thorsten Blum Reviewed-by: Lukas Wunner Reviewed-by: Jarkko Sakkinen Signed-off-by: Herbert Xu --- diff --git a/include/keys/asymmetric-type.h b/include/keys/asymmetric-type.h index 69a13e1e5b2e5..1b91c8f98688d 100644 --- a/include/keys/asymmetric-type.h +++ b/include/keys/asymmetric-type.h @@ -49,7 +49,7 @@ enum asymmetric_payload_bits { */ struct asymmetric_key_id { unsigned short len; - unsigned char data[]; + unsigned char data[] __counted_by(len); }; struct asymmetric_key_ids {