Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

lib/crypto: tests: Fix KMSAN warning in test_sha256_finup_2x()

Fully initialize *ctx, including the buf field which sha256_init()
doesn't initialize, to avoid a KMSAN warning when comparing *ctx to
orig_ctx. This KMSAN warning slipped in while KMSAN was not working
reliably due to a stackdepot bug, which has now been fixed.

Fixes: 6733968be7cb ("lib/crypto: tests: Add tests and benchmark for sha256_finup_2x()")
Acked-by: Ard Biesheuvel <ardb@kernel.org>
Link: https://lore.kernel.org/r/20251121033431.34406-1-ebiggers@kernel.org
Signed-off-by: Eric Biggers <ebiggers@kernel.org>

+1
+1
lib/crypto/tests/sha256_kunit.c
··· 68 68 rand_bytes(data1_buf, max_data_len); 69 69 rand_bytes(data2_buf, max_data_len); 70 70 rand_bytes(salt, sizeof(salt)); 71 + memset(ctx, 0, sizeof(*ctx)); 71 72 72 73 for (size_t i = 0; i < 500; i++) { 73 74 size_t salt_len = rand_length(sizeof(salt));