Commit 18e2188c authored by Thorsten Blum's avatar Thorsten Blum Committed by Herbert Xu

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: default avatarKees Cook <kees@kernel.org>
Signed-off-by: default avatarThorsten Blum <thorsten.blum@toblux.com>
Signed-off-by: default avatarHerbert Xu <herbert@gondor.apana.org.au>
parent 2d6213bd
......@@ -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 {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment