mirror of
https://github.com/torvalds/linux.git
synced 2024-11-10 06:01:57 +00:00
crypto: chacha20poly1305 - Annotate struct chachapoly_ctx with __counted_by()
Add the __counted_by compiler attribute to the flexible array member salt to improve access bounds-checking via CONFIG_UBSAN_BOUNDS and CONFIG_FORTIFY_SOURCE. Reviewed-by: Kees Cook <kees@kernel.org> Signed-off-by: Thorsten Blum <thorsten.blum@toblux.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
parent
2d6213bd59
commit
18e2188c4b
@ -27,7 +27,7 @@ struct chachapoly_ctx {
|
||||
struct crypto_ahash *poly;
|
||||
/* key bytes we use for the ChaCha20 IV */
|
||||
unsigned int saltlen;
|
||||
u8 salt[];
|
||||
u8 salt[] __counted_by(saltlen);
|
||||
};
|
||||
|
||||
struct poly_req {
|
||||
|
Loading…
Reference in New Issue
Block a user