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

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
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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 {