linux/arch/powerpc
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
..
boot powerpc/boot: Add version to install filenames 2023-10-20 17:34:26 +11:00
configs powerpc updates for 6.7 2023-11-03 10:07:39 -10:00
crypto crypto: p10-aes-gcm - Avoid -Wstringop-overflow warnings 2023-12-01 18:03:26 +08:00
include powerpc fixes for 6.7 #2 2023-11-12 10:50:38 -08:00
kernel powerpc fixes for 6.7 #2 2023-11-12 10:50:38 -08:00
kexec powerpc updates for 6.7 2023-11-03 10:07:39 -10:00
kvm powerpc updates for 6.7 2023-11-03 10:07:39 -10:00
lib powerpc/code-patching: introduce patch_instructions() 2023-10-23 20:33:19 +11:00
math-emu
mm powerpc: Remove file parameter from phys_mem_access_prot() 2023-11-06 15:21:33 +11:00
net powerpc/bpf: use bpf_jit_binary_pack_[alloc|finalize|free] 2023-10-23 20:33:19 +11:00
perf powerpc/perf: Fix disabling BHRB and instruction sampling 2023-10-20 22:40:20 +11:00
platforms powerpc/pseries/rtas-work-area: Fix rtas_work_area_reserve_arena() kernel-doc 2023-11-07 13:13:44 +11:00
purgatory powerpc/purgatory: remove PGO flags 2023-06-12 11:31:50 -07:00
sysdev powerpc/fsl_msi: Use device_get_match_data() 2023-10-20 23:18:34 +11:00
tools powerpc/tools: Pass -mabi=elfv2 to gcc-check-mprofile-kernel.sh 2023-10-20 17:46:33 +11:00
xmon TTY/Serial driver changes for 6.6-rc1 2023-09-01 09:38:00 -07:00
Kbuild
Kconfig powerpc/trace: Add support for HAVE_FUNCTION_ARG_ACCESS_API 2023-10-20 17:55:56 +11:00
Kconfig.debug Merge branch 'topic/ppc-kvm' into next 2023-10-27 20:58:03 +11:00
Makefile powerpc/64s: Move CPU -mtune options into Kconfig 2023-08-25 08:39:29 +10:00
Makefile.postlink kbuild: remove ARCH_POSTLINK from module builds 2023-10-28 21:10:08 +09:00