[syzbot] [crypto?] KMSAN: kernel-infoleak in rng_recvmsg

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

syzbot found the following issue on:

HEAD commit:    6e64f4580381 Merge tag 'input-for-v6.17-rc0' of git://git...
git tree:       upstream
console+strace: https://syzkaller.appspot.com/x/log.txt?x=14a181a2580000
kernel config:  https://syzkaller.appspot.com/x/.config?x=b6003cf8ecb92ff2
dashboard link: https://syzkaller.appspot.com/bug?extid=e8bcd7ee3db6cb5cb875
compiler:       Debian clang version 20.1.7 (++20250616065708+6146a88f6049-1~exp1~20250616065826.132), Debian LLD 20.1.7
syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=117fa1a2580000
C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=105e9058580000

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/3d9a1192a7cc/disk-6e64f458.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/8f363fe8f54a/vmlinux-6e64f458.xz
kernel image: https://storage.googleapis.com/syzbot-assets/10b73833a575/bzImage-6e64f458.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+e8bcd7ee3db6cb5cb875@xxxxxxxxxxxxxxxxxxxxxxxxx

=====================================================
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
=====================================================


---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzkaller@xxxxxxxxxxxxxxxx.

syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.

If the report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title

If you want syzbot to run the reproducer, reply with:
#syz test: git://repo/address.git branch-or-commit-hash
If you attach or paste a git patch, syzbot will apply it before testing.

If you want to overwrite report's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)

If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-report

If you want to undo deduplication, reply with:
#syz undup




[Index of Archives]     [Kernel]     [Gnu Classpath]     [Gnu Crypto]     [DM Crypt]     [Netfilter]     [Bugtraq]
  Powered by Linux