diff options
| author | Thorsten Blum <thorsten.blum@linux.dev> | 2025-10-23 19:48:11 +0200 |
|---|---|---|
| committer | Herbert Xu <herbert@gondor.apana.org.au> | 2025-10-31 17:43:56 +0800 |
| commit | 12ad5b2346f905a3962b4aee701191b7a8d1905a (patch) | |
| tree | 8e2903f8cefee025094a93d87ed68c6b0edeedac | |
| parent | 841940df6f6eb825af9f15a1587fb3b28fe3cb4f (diff) | |
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 <thorsten.blum@linux.dev>
Reviewed-by: Lukas Wunner <lukas@wunner.de>
Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
| -rw-r--r-- | include/keys/asymmetric-type.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/keys/asymmetric-type.h b/include/keys/asymmetric-type.h index 69a13e1e5b2e..1b91c8f98688 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 { |
