mirror of https://github.com/torvalds/linux.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 <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>
This commit is contained in:
parent
841940df6f
commit
12ad5b2346
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Reference in New Issue