mirror of
https://github.com/torvalds/linux.git
synced 2024-11-14 16:12:02 +00:00
aaa03fdb56
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> |
||
---|---|---|
.. | ||
.gitignore | ||
aes-gcm-p10-glue.c | ||
aes-gcm-p10.S | ||
aes-spe-core.S | ||
aes-spe-glue.c | ||
aes-spe-keys.S | ||
aes-spe-modes.S | ||
aes-spe-regs.h | ||
aes-tab-4k.S | ||
aesp10-ppc.pl | ||
chacha-p10-glue.c | ||
chacha-p10le-8x.S | ||
crc32-vpmsum_core.S | ||
crc32c-vpmsum_asm.S | ||
crc32c-vpmsum_glue.c | ||
crc-vpmsum_test.c | ||
crct10dif-vpmsum_asm.S | ||
crct10dif-vpmsum_glue.c | ||
ghashp10-ppc.pl | ||
Kconfig | ||
Makefile | ||
md5-asm.S | ||
md5-glue.c | ||
poly1305-p10-glue.c | ||
poly1305-p10le_64.S | ||
ppc-xlate.pl | ||
sha1-powerpc-asm.S | ||
sha1-spe-asm.S | ||
sha1-spe-glue.c | ||
sha1.c | ||
sha256-spe-asm.S | ||
sha256-spe-glue.c |