lib/crypto/sm3.c:169:6: warning: stack frame size (1200) exceeds limit (1024) in 'sm3_block_generic'

From: kernel test robot
Date: Mon Jun 23 2025 - 13:39:04 EST


tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 86731a2a651e58953fc949573895f2fa6d456841
commit: cb16ba46958e41f8d805cbdb027a601b3a0c65b4 crypto: lib/sm3 - Export generic block function
date: 10 weeks ago
config: riscv-allmodconfig (https://download.01.org/0day-ci/archive/20250624/202506240133.iBttMRY7-lkp@xxxxxxxxx/config)
compiler: clang version 21.0.0git (https://github.com/llvm/llvm-project 875b36a8742437b95f623bab1e0332562c7b4b3f)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250624/202506240133.iBttMRY7-lkp@xxxxxxxxx/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202506240133.iBttMRY7-lkp@xxxxxxxxx/

All warnings (new ones prefixed by >>):

>> lib/crypto/sm3.c:169:6: warning: stack frame size (1200) exceeds limit (1024) in 'sm3_block_generic' [-Wframe-larger-than]
169 | void sm3_block_generic(struct sm3_state *sctx, u8 const *data, int blocks)
| ^
1 warning generated.


vim +/sm3_block_generic +169 lib/crypto/sm3.c

168
> 169 void sm3_block_generic(struct sm3_state *sctx, u8 const *data, int blocks)
170 {
171 u32 W[16];
172
173 do {
174 sm3_transform(sctx, data, W);
175 data += SM3_BLOCK_SIZE;
176 } while (--blocks);
177
178 memzero_explicit(W, sizeof(W));
179 }
180 EXPORT_SYMBOL_GPL(sm3_block_generic);
181

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki