Kernel bug: KMSAN: kernel-infoleak in rng_recvmsg
Subsystem: crypto
Status: fixed

Crash report:
=====================================================
BUG: KMSAN: kernel-infoleak in instrument_copy_to_user include/linux/instrumented.h:114 [inline]
BUG: KMSAN: kernel-infoleak in copy_to_user_iter lib/iov_iter.c:24 [inline]
BUG: KMSAN: kernel-infoleak in iterate_ubuf include/linux/iov_iter.h:30 [inline]
BUG: KMSAN: kernel-infoleak in iterate_and_advance2 include/linux/iov_iter.h:300 [inline]
BUG: KMSAN: kernel-infoleak in iterate_and_advance include/linux/iov_iter.h:328 [inline]
BUG: KMSAN: kernel-infoleak in _copy_to_iter+0xf0e/0x33f0 lib/iov_iter.c:185
 instrument_copy_to_user include/linux/instrumented.h:114 [inline]
 copy_to_user_iter lib/iov_iter.c:24 [inline]
 iterate_ubuf include/linux/iov_iter.h:30 [inline]
 iterate_and_advance2 include/linux/iov_iter.h:300 [inline]
 iterate_and_advance include/linux/iov_iter.h:328 [inline]
 _copy_to_iter+0xf0e/0x33f0 lib/iov_iter.c:185
 copy_to_iter include/linux/uio.h:220 [inline]
 memcpy_to_msg include/linux/skbuff.h:4202 [inline]
 _rng_recvmsg crypto/algif_rng.c:101 [inline]
 rng_recvmsg+0x1af/0x2d0 crypto/algif_rng.c:114
 sock_recvmsg_nosec net/socket.c:1065 [inline]
 sock_recvmsg+0x2df/0x390 net/socket.c:1087
 sock_read_iter+0x2c8/0x360 net/socket.c:1157
 new_sync_read fs/read_write.c:491 [inline]
 vfs_read+0x857/0xf00 fs/read_write.c:572
 ksys_read fs/read_write.c:715 [inline]
 __do_sys_read fs/read_write.c:724 [inline]
 __se_sys_read fs/read_write.c:722 [inline]
 __x64_sys_read+0x1fb/0x4d0 fs/read_write.c:722
 x64_sys_call+0x2f9c/0x3e20 arch/x86/include/generated/asm/syscalls_64.h:1
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0xd9/0x210 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

<Zero or more stacks not recorded to save memory>

Uninit was stored to memory at:
 crypto_sha3_finup+0x136/0xe00 crypto/sha3_generic.c:202
 crypto_shash_op_and_zero crypto/shash.c:105 [inline]
 crypto_shash_finup+0x327/0xe80 crypto/shash.c:171
 jent_hash_time+0x247/0x590 crypto/jitterentropy-kcapi.c:138
 jent_condition_data+0x4f0/0x510 crypto/jitterentropy.c:438
 jent_measure_jitter+0x547/0x770 crypto/jitterentropy.c:541
 jent_gen_entropy+0x209/0x450 crypto/jitterentropy.c:569
 jent_read_entropy+0x353/0xeb0 crypto/jitterentropy.c:615
 jent_kcapi_random+0x6c/0x250 crypto/jitterentropy-kcapi.c:284
 crypto_rng_generate include/crypto/rng.h:144 [inline]
 _rng_recvmsg crypto/algif_rng.c:97 [inline]
 rng_recvmsg+0x149/0x2d0 crypto/algif_rng.c:114
 sock_recvmsg_nosec net/socket.c:1065 [inline]
 sock_recvmsg+0x2df/0x390 net/socket.c:1087
 sock_read_iter+0x2c8/0x360 net/socket.c:1157
 new_sync_read fs/read_write.c:491 [inline]
 vfs_read+0x857/0xf00 fs/read_write.c:572
 ksys_read fs/read_write.c:715 [inline]
 __do_sys_read fs/read_write.c:724 [inline]
 __se_sys_read fs/read_write.c:722 [inline]
 __x64_sys_read+0x1fb/0x4d0 fs/read_write.c:722
 x64_sys_call+0x2f9c/0x3e20 arch/x86/include/generated/asm/syscalls_64.h:1
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0xd9/0x210 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

Uninit was stored to memory at:
 crypto_shash_finup+0xc5a/0xe80 crypto/shash.c:162
 crypto_shash_update include/crypto/hash.h:994 [inline]
 jent_hash_time+0x1de/0x590 crypto/jitterentropy-kcapi.c:136
 jent_condition_data+0x4f0/0x510 crypto/jitterentropy.c:438
 jent_measure_jitter+0x547/0x770 crypto/jitterentropy.c:541
 jent_gen_entropy+0x209/0x450 crypto/jitterentropy.c:569
 jent_read_entropy+0x353/0xeb0 crypto/jitterentropy.c:615
 jent_kcapi_random+0x6c/0x250 crypto/jitterentropy-kcapi.c:284
 crypto_rng_generate include/crypto/rng.h:144 [inline]
 _rng_recvmsg crypto/algif_rng.c:97 [inline]
 rng_recvmsg+0x149/0x2d0 crypto/algif_rng.c:114
 sock_recvmsg_nosec net/socket.c:1065 [inline]
 sock_recvmsg+0x2df/0x390 net/socket.c:1087
 sock_read_iter+0x2c8/0x360 net/socket.c:1157
 new_sync_read fs/read_write.c:491 [inline]
 vfs_read+0x857/0xf00 fs/read_write.c:572
 ksys_read fs/read_write.c:715 [inline]
 __do_sys_read fs/read_write.c:724 [inline]
 __se_sys_read fs/read_write.c:722 [inline]
 __x64_sys_read+0x1fb/0x4d0 fs/read_write.c:722
 x64_sys_call+0x2f9c/0x3e20 arch/x86/include/generated/asm/syscalls_64.h:1
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0xd9/0x210 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

Uninit was stored to memory at:
 put_unaligned_le64 include/linux/unaligned.h:43 [inline]
 crypto_sha3_finup+0xc98/0xe00 crypto/sha3_generic.c:213
 crypto_shash_op_and_zero crypto/shash.c:105 [inline]
 crypto_shash_finup+0x327/0xe80 crypto/shash.c:171
 jent_hash_time+0x247/0x590 crypto/jitterentropy-kcapi.c:138
 jent_condition_data+0x4f0/0x510 crypto/jitterentropy.c:438
 jent_measure_jitter+0x547/0x770 crypto/jitterentropy.c:541
 jent_gen_entropy+0x209/0x450 crypto/jitterentropy.c:569
 jent_read_entropy+0x353/0xeb0 crypto/jitterentropy.c:615
 jent_kcapi_random+0x6c/0x250 crypto/jitterentropy-kcapi.c:284
 crypto_rng_generate include/crypto/rng.h:144 [inline]
 _rng_recvmsg crypto/algif_rng.c:97 [inline]
 rng_recvmsg+0x149/0x2d0 crypto/algif_rng.c:114
 sock_recvmsg_nosec net/socket.c:1065 [inline]
 sock_recvmsg+0x2df/0x390 net/socket.c:1087
 sock_read_iter+0x2c8/0x360 net/socket.c:1157
 new_sync_read fs/read_write.c:491 [inline]
 vfs_read+0x857/0xf00 fs/read_write.c:572
 ksys_read fs/read_write.c:715 [inline]
 __do_sys_read fs/read_write.c:724 [inline]
 __se_sys_read fs/read_write.c:722 [inline]
 __x64_sys_read+0x1fb/0x4d0 fs/read_write.c:722
 x64_sys_call+0x2f9c/0x3e20 arch/x86/include/generated/asm/syscalls_64.h:1
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0xd9/0x210 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

Uninit was stored to memory at:
 keccakf_round crypto/sha3_generic.c:-1 [inline]
 keccakf+0x1efb/0x2110 crypto/sha3_generic.c:155
 crypto_sha3_finup+0x772/0xe00 crypto/sha3_generic.c:210
 crypto_shash_op_and_zero crypto/shash.c:105 [inline]
 crypto_shash_finup+0x327/0xe80 crypto/shash.c:171
 jent_hash_time+0x247/0x590 crypto/jitterentropy-kcapi.c:138
 jent_condition_data+0x4f0/0x510 crypto/jitterentropy.c:438
 jent_measure_jitter+0x547/0x770 crypto/jitterentropy.c:541
 jent_gen_entropy+0x209/0x450 crypto/jitterentropy.c:569
 jent_read_entropy+0x353/0xeb0 crypto/jitterentropy.c:615
 jent_kcapi_random+0x6c/0x250 crypto/jitterentropy-kcapi.c:284
 crypto_rng_generate include/crypto/rng.h:144 [inline]
 _rng_recvmsg crypto/algif_rng.c:97 [inline]
 rng_recvmsg+0x149/0x2d0 crypto/algif_rng.c:114
 sock_recvmsg_nosec net/socket.c:1065 [inline]
 sock_recvmsg+0x2df/0x390 net/socket.c:1087
 sock_read_iter+0x2c8/0x360 net/socket.c:1157
 new_sync_read fs/read_write.c:491 [inline]
 vfs_read+0x857/0xf00 fs/read_write.c:572
 ksys_read fs/read_write.c:715 [inline]
 __do_sys_read fs/read_write.c:724 [inline]
 __se_sys_read fs/read_write.c:722 [inline]
 __x64_sys_read+0x1fb/0x4d0 fs/read_write.c:722
 x64_sys_call+0x2f9c/0x3e20 arch/x86/include/generated/asm/syscalls_64.h:1
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0xd9/0x210 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

Uninit was stored to memory at:
 crypto_sha3_finup+0x5be/0xe00 crypto/sha3_generic.c:207
 crypto_shash_op_and_zero crypto/shash.c:105 [inline]
 crypto_shash_finup+0x327/0xe80 crypto/shash.c:171
 jent_hash_time+0x247/0x590 crypto/jitterentropy-kcapi.c:138
 jent_condition_data+0x4f0/0x510 crypto/jitterentropy.c:438
 jent_measure_jitter+0x547/0x770 crypto/jitterentropy.c:541
 jent_gen_entropy+0x209/0x450 crypto/jitterentropy.c:569
 jent_read_entropy+0x353/0xeb0 crypto/jitterentropy.c:615
 jent_kcapi_random+0x6c/0x250 crypto/jitterentropy-kcapi.c:284
 crypto_rng_generate include/crypto/rng.h:144 [inline]
 _rng_recvmsg crypto/algif_rng.c:97 [inline]
 rng_recvmsg+0x149/0x2d0 crypto/algif_rng.c:114
 sock_recvmsg_nosec net/socket.c:1065 [inline]
 sock_recvmsg+0x2df/0x390 net/socket.c:1087
 sock_read_iter+0x2c8/0x360 net/socket.c:1157
 new_sync_read fs/read_write.c:491 [inline]
 vfs_read+0x857/0xf00 fs/read_write.c:572
 ksys_read fs/read_write.c:715 [inline]
 __do_sys_read fs/read_write.c:724 [inline]
 __se_sys_read fs/read_write.c:722 [inline]
 __x64_sys_read+0x1fb/0x4d0 fs/read_write.c:722
 x64_sys_call+0x2f9c/0x3e20 arch/x86/include/generated/asm/syscalls_64.h:1
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0xd9/0x210 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

Uninit was stored to memory at:
 crypto_sha3_finup+0x136/0xe00 crypto/sha3_generic.c:202
 crypto_shash_op_and_zero crypto/shash.c:105 [inline]
 crypto_shash_finup+0x327/0xe80 crypto/shash.c:171
 jent_hash_time+0x247/0x590 crypto/jitterentropy-kcapi.c:138
 jent_condition_data+0x4f0/0x510 crypto/jitterentropy.c:438
 jent_measure_jitter+0x547/0x770 crypto/jitterentropy.c:541
 jent_gen_entropy+0x209/0x450 crypto/jitterentropy.c:569
 jent_read_entropy+0x353/0xeb0 crypto/jitterentropy.c:615
 jent_kcapi_random+0x6c/0x250 crypto/jitterentropy-kcapi.c:284
 crypto_rng_generate include/crypto/rng.h:144 [inline]
 _rng_recvmsg crypto/algif_rng.c:97 [inline]
 rng_recvmsg+0x149/0x2d0 crypto/algif_rng.c:114
 sock_recvmsg_nosec net/socket.c:1065 [inline]
 sock_recvmsg+0x2df/0x390 net/socket.c:1087
 sock_read_iter+0x2c8/0x360 net/socket.c:1157
 new_sync_read fs/read_write.c:491 [inline]
 vfs_read+0x857/0xf00 fs/read_write.c:572
 ksys_read fs/read_write.c:715 [inline]
 __do_sys_read fs/read_write.c:724 [inline]
 __se_sys_read fs/read_write.c:722 [inline]
 __x64_sys_read+0x1fb/0x4d0 fs/read_write.c:722
 x64_sys_call+0x2f9c/0x3e20 arch/x86/include/generated/asm/syscalls_64.h:1
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0xd9/0x210 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

Uninit was stored to memory at:
 crypto_shash_finup+0xc5a/0xe80 crypto/shash.c:162
 crypto_shash_update include/crypto/hash.h:994 [inline]
 jent_hash_time+0x1de/0x590 crypto/jitterentropy-kcapi.c:136
 jent_condition_data+0x4f0/0x510 crypto/jitterentropy.c:438
 jent_measure_jitter+0x547/0x770 crypto/jitterentropy.c:541
 jent_gen_entropy+0x209/0x450 crypto/jitterentropy.c:569
 jent_read_entropy+0x353/0xeb0 crypto/jitterentropy.c:615
 jent_kcapi_random+0x6c/0x250 crypto/jitterentropy-kcapi.c:284
 crypto_rng_generate include/crypto/rng.h:144 [inline]
 _rng_recvmsg crypto/algif_rng.c:97 [inline]
 rng_recvmsg+0x149/0x2d0 crypto/algif_rng.c:114
 sock_recvmsg_nosec net/socket.c:1065 [inline]
 sock_recvmsg+0x2df/0x390 net/socket.c:1087
 sock_read_iter+0x2c8/0x360 net/socket.c:1157
 new_sync_read fs/read_write.c:491 [inline]
 vfs_read+0x857/0xf00 fs/read_write.c:572
 ksys_read fs/read_write.c:715 [inline]
 __do_sys_read fs/read_write.c:724 [inline]
 __se_sys_read fs/read_write.c:722 [inline]
 __x64_sys_read+0x1fb/0x4d0 fs/read_write.c:722
 x64_sys_call+0x2f9c/0x3e20 arch/x86/include/generated/asm/syscalls_64.h:1
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0xd9/0x210 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

Local variable intermediary created at:
 jent_hash_time+0x9b/0x590 crypto/jitterentropy-kcapi.c:110
 jent_condition_data+0x4f0/0x510 crypto/jitterentropy.c:438

Bytes 0-23 of 24 are uninitialized
Memory access of size 24 starts at ffff88811855fb70
Data copied to user address 00002000000001c0

CPU: 1 UID: 0 PID: 5820 Comm: syz-executor170 Not tainted 6.16.0-syzkaller-11952-g6e64f4580381 #0 PREEMPT(none) 
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/12/2025
=====================================================