Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Thorsten Blum and committed by
Herbert Xu
18e2188c 2d6213bd

+1 -1
+1 -1
crypto/chacha20poly1305.c
··· 27 27 struct crypto_ahash *poly; 28 28 /* key bytes we use for the ChaCha20 IV */ 29 29 unsigned int saltlen; 30 - u8 salt[]; 30 + u8 salt[] __counted_by(saltlen); 31 31 }; 32 32 33 33 struct poly_req {