linux/arch/powerpc/crypto
Gustavo A. R. Silva aaa03fdb56 crypto: p10-aes-gcm - Avoid -Wstringop-overflow warnings
The compiler doesn't know that `32` is an offset into the Hash table:

 56 struct Hash_ctx {
 57         u8 H[16];       /* subkey */
 58         u8 Htable[256]; /* Xi, Hash table(offset 32) */
 59 };

So, it legitimately complains about a potential out-of-bounds issue
if `256 bytes` are accessed in `htable` (this implies going
`32 bytes` beyond the boundaries of `Htable`):

arch/powerpc/crypto/aes-gcm-p10-glue.c: In function 'gcmp10_init':
arch/powerpc/crypto/aes-gcm-p10-glue.c:120:9: error: 'gcm_init_htable' accessing 256 bytes in a region of size 224 [-Werror=stringop-overflow=]
  120 |         gcm_init_htable(hash->Htable+32, hash->H);
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/powerpc/crypto/aes-gcm-p10-glue.c:120:9: note: referencing argument 1 of type 'unsigned char[256]'
arch/powerpc/crypto/aes-gcm-p10-glue.c:120:9: note: referencing argument 2 of type 'unsigned char[16]'
arch/powerpc/crypto/aes-gcm-p10-glue.c:40:17: note: in a call to function 'gcm_init_htable'
   40 | asmlinkage void gcm_init_htable(unsigned char htable[256], unsigned char Xi[16]);
      |                 ^~~~~~~~~~~~~~~

Address this by avoiding specifying the size of `htable` in the function
prototype; and just for consistency, do the same for parameter `Xi`.

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Closes: https://lore.kernel.org/linux-next/20231121131903.68a37932@canb.auug.org.au/
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2023-12-01 18:03:26 +08:00
..
.gitignore powerpc/crypto: Add gitignore for generated P10 AES/GCM .S files 2023-07-17 13:52:46 +10:00
aes-gcm-p10-glue.c crypto: p10-aes-gcm - Avoid -Wstringop-overflow warnings 2023-12-01 18:03:26 +08:00
aes-gcm-p10.S crypto: p10-aes-gcm - An accelerated AES/GCM stitched implementation 2023-03-14 17:06:43 +08:00
aes-spe-core.S treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
aes-spe-glue.c cyrpto: powerpc/aes - delete the rebundant word "block" in comments 2022-07-22 16:22:04 +08:00
aes-spe-keys.S treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
aes-spe-modes.S treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
aes-spe-regs.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
aes-tab-4k.S treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
aesp10-ppc.pl powerpc/crypto: Fix aes-gcm-p10 link errors 2023-05-30 15:50:32 +10:00
chacha-p10-glue.c crypt: chacha20-p10 - Glue code for optmized Chacha20 implementation for ppc64le 2023-07-14 18:21:31 +10:00
chacha-p10le-8x.S crypto: chacha20-p10 - An optimized Chacha20 implementation with 8-way unrolling for ppc64le 2023-07-14 18:21:30 +10:00
crc32-vpmsum_core.S crypto: powerpc - Use address generation helper for asm 2023-02-10 22:17:36 +11:00
crc32c-vpmsum_asm.S treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
crc32c-vpmsum_glue.c crypto: remove CRYPTO_TFM_RES_BAD_KEY_LEN 2020-01-09 11:30:53 +08:00
crc-vpmsum_test.c treewide: use get_random_u32_below() instead of deprecated function 2022-11-18 02:15:15 +01:00
crct10dif-vpmsum_asm.S treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 136 2019-05-30 11:25:15 -07:00
crct10dif-vpmsum_glue.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
ghashp10-ppc.pl powerpc/crypto: Fix aes-gcm-p10 link errors 2023-05-30 15:50:32 +10:00
Kconfig This push fixes a random config build failure on powerpc. 2023-09-01 15:39:25 -07:00
Makefile crypto: powerpc - Add chacha20/poly1305-p10 to Kconfig and Makefile 2023-07-14 18:23:13 +10:00
md5-asm.S powerpc: flexible GPR range save/restore macros 2021-11-29 23:15:20 +11:00
md5-glue.c crypto: lib/sha1 - remove unnecessary includes of linux/cryptohash.h 2020-05-08 15:32:17 +10:00
poly1305-p10-glue.c crypto: poly1305-p10 - Glue code for optmized Poly1305 implementation for ppc64le 2023-07-14 18:21:31 +10:00
poly1305-p10le_64.S crypto: poly1305-p10 - An optimized Poly1305 implementation with 4-way unrolling for ppc64le 2023-07-14 18:21:31 +10:00
ppc-xlate.pl crypto: p10-aes-gcm - A perl script to process PowerPC assembler source. 2023-03-14 17:06:43 +08:00
sha1-powerpc-asm.S powerpc: flexible GPR range save/restore macros 2021-11-29 23:15:20 +11:00
sha1-spe-asm.S treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
sha1-spe-glue.c crypto: powerpc/sha - remove duplicate hash init function 2021-12-31 18:10:55 +11:00
sha1.c crypto: powerpc/sha - remove duplicate hash init function 2021-12-31 18:10:55 +11:00
sha256-spe-asm.S treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152 2019-05-30 11:26:32 -07:00
sha256-spe-glue.c crypto: powerpc/sha - remove duplicate hash init function 2021-12-31 18:10:55 +11:00