[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <202509191938.PrHY82Kd-lkp@intel.com>
Date: Fri, 19 Sep 2025 19:33:10 +0800
From: kernel test robot <lkp@...el.com>
To: David Howells <dhowells@...hat.com>, Eric Biggers <ebiggers@...nel.org>
Cc: oe-kbuild-all@...ts.linux.dev, dhowells@...hat.com,
"Jason A. Donenfeld" <Jason@...c4.com>,
Ard Biesheuvel <ardb@...nel.org>,
Herbert Xu <herbert@...dor.apana.org.au>,
Stephan Mueller <smueller@...onox.de>, linux-crypto@...r.kernel.org,
keyrings@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] lib/crypto: Add SHA3-224, SHA3-256, SHA3-384, SHA-512,
SHAKE128, SHAKE256
Hi David,
kernel test robot noticed the following build warnings:
[auto build test WARNING on ebiggers/libcrypto-fixes]
[also build test WARNING on herbert-cryptodev-2.6/master herbert-crypto-2.6/master linus/master v6.17-rc6 next-20250918]
[cannot apply to ebiggers/libcrypto-next]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]
url: https://github.com/intel-lab-lkp/linux/commits/David-Howells/lib-crypto-Add-SHA3-224-SHA3-256-SHA3-384-SHA-512-SHAKE128-SHAKE256/20250919-061024
base: https://git.kernel.org/pub/scm/linux/kernel/git/ebiggers/linux.git libcrypto-fixes
patch link: https://lore.kernel.org/r/3605112.1758233248%40warthog.procyon.org.uk
patch subject: [PATCH] lib/crypto: Add SHA3-224, SHA3-256, SHA3-384, SHA-512, SHAKE128, SHAKE256
config: arc-randconfig-r112-20250919 (https://download.01.org/0day-ci/archive/20250919/202509191938.PrHY82Kd-lkp@intel.com/config)
compiler: arc-linux-gcc (GCC) 10.5.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250919/202509191938.PrHY82Kd-lkp@intel.com/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@...el.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202509191938.PrHY82Kd-lkp@intel.com/
sparse warnings: (new ones prefixed by >>)
>> lib/crypto/sha3.c:317:11: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted __le64 [usertype] *s @@ got unsigned long long * @@
lib/crypto/sha3.c:317:11: sparse: expected restricted __le64 [usertype] *s
lib/crypto/sha3.c:317:11: sparse: got unsigned long long *
>> lib/crypto/sha3.c:319:36: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned long long [usertype] val @@ got restricted __le64 [usertype] @@
lib/crypto/sha3.c:319:36: sparse: expected unsigned long long [usertype] val
lib/crypto/sha3.c:319:36: sparse: got restricted __le64 [usertype]
vim +317 lib/crypto/sha3.c
271
272 /**
273 * sha3_final() - Finish computing a SHA3 message digest of any type
274 * @ctx: the context to finalize; must have been initialized
275 * @out: (output) the resulting message digest
276 *
277 * Finish the computation of a SHA3 message digest of any type and perform the
278 * "Keccak sponge squeezing" phase. The digest is written to @out buffer and
279 * the size of the digest is returned. Before returning, the context @ctx is
280 * cleared so that the caller does not need to do it.
281 */
282 int sha3_final(struct sha3_ctx *ctx, u8 *out)
283 {
284 struct sha3_state *state = &ctx->state;
285 unsigned int digest_size = ctx->digest_size;
286 unsigned int bsize = ctx->block_size;
287 u8 end_marker = 0x80;
288
289 sha3_absorb_xorle(ctx, &ctx->padding, 1);
290 ctx->partial = bsize - 1;
291 sha3_absorb_xorle(ctx, &end_marker, 1);
292 sha3_keccakf(ctx->state.st);
293
294 #ifdef __LITTLE_ENDIAN
295 for (;;) {
296 unsigned int part = umin(digest_size, bsize);
297
298 memcpy(out, state->st, part);
299 digest_size -= part;
300 if (!digest_size)
301 goto done;
302 out += part;
303 sha3_keccakf(ctx->state.st);
304 }
305 #else
306 __le64 *digest = (__le64 *)out, *s;
307
308 while (digest_size >= bsize) {
309 for (int i = 0; i < bsize / 8; i++)
310 put_unaligned_le64(state->st[i], digest++);
311 digest_size -= bsize;
312 if (!digest_size)
313 goto done;
314 sha3_keccakf(ctx->state.st);
315 }
316
> 317 s = state->st;
318 for (; digest_size >= 8; digest_size -= 8)
> 319 put_unaligned_le64(*s++, digest++);
320
321 u8 *sc = (u8 *)s;
322 u8 *dc = (u8 *)digest;
323
324 for (; digest_size >= 1; digest_size -= 1)
325 *dc++ = *sc++;
326 #endif
327 done:
328 digest_size = ctx->digest_size;
329 memzero_explicit(ctx, sizeof(*ctx));
330 return digest_size;
331 }
332 EXPORT_SYMBOL_GPL(sha3_final);
333
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
Powered by blists - more mailing lists