syzbot


KMSAN: uninit-value in aes_encrypt (3)

Status: closed as invalid on 2020/07/22 14:12
Subsystems: crypto
[Documentation on labels]
First crash: 1428d, last: 1427d
Similar bugs (4)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KMSAN: uninit-value in aes_encrypt crypto C 2 2259d 2259d 0/27 closed as invalid on 2018/06/27 14:58
upstream KMSAN: uninit-value in aes_encrypt (5) ext4 C 23 2d05h 47d 0/27 upstream: reported C repro on 2024/04/28 10:32
upstream KMSAN: uninit-value in aes_encrypt (4) net C 15041 158d 1373d 0/27 auto-obsoleted due to no activity on 2024/03/19 00:25
upstream KMSAN: uninit-value in aes_encrypt (2) crypto C 52 1666d 1695d 0/27 closed as dup on 2019/11/19 02:55

Sample crash report:
=====================================================
BUG: KMSAN: uninit-value in subshift lib/crypto/aes.c:149 [inline]
BUG: KMSAN: uninit-value in aes_encrypt+0x12c5/0x1bc0 lib/crypto/aes.c:282
CPU: 0 PID: 11225 Comm: syz-executor286 Not tainted 5.8.0-rc5-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011
Call Trace:
 __dump_stack lib/dump_stack.c:77 [inline]
 dump_stack+0x1df/0x240 lib/dump_stack.c:118
 kmsan_report+0xf7/0x1e0 mm/kmsan/kmsan_report.c:121
 __msan_warning+0x58/0xa0 mm/kmsan/kmsan_instr.c:215
 subshift lib/crypto/aes.c:149 [inline]
 aes_encrypt+0x12c5/0x1bc0 lib/crypto/aes.c:282
 aesti_encrypt+0xe8/0x130 crypto/aes_ti.c:31
 cipher_crypt_one crypto/cipher.c:75 [inline]
 crypto_cipher_encrypt_one+0x1a9/0x380 crypto/cipher.c:82
 crypto_cmac_digest_final+0x55b/0x590 crypto/cmac.c:195
 crypto_shash_final+0x394/0x450 crypto/shash.c:160
 shash_finup_unaligned+0x120/0x160 crypto/shash.c:168
 crypto_shash_finup+0x2b4/0x6b0 crypto/shash.c:181
 shash_digest_unaligned+0x22b/0x260 crypto/shash.c:189
 crypto_shash_digest crypto/shash.c:205 [inline]
 shash_ahash_digest+0x788/0x8a0 crypto/shash.c:322
 shash_async_digest+0xbb/0x110 crypto/shash.c:340
 crypto_ahash_op+0x1c6/0x6c0 crypto/ahash.c:370
 crypto_ahash_digest+0xdc/0x150 crypto/ahash.c:412
 hash_sendpage+0x9cc/0xdf0 crypto/algif_hash.c:159
 kernel_sendpage net/socket.c:3642 [inline]
 sock_sendpage+0x1e1/0x2c0 net/socket.c:945
 pipe_to_sendpage+0x38c/0x4c0 fs/splice.c:448
 splice_from_pipe_feed fs/splice.c:502 [inline]
 __splice_from_pipe+0x565/0xf00 fs/splice.c:626
 splice_from_pipe fs/splice.c:661 [inline]
 generic_splice_sendpage+0x1d5/0x2d0 fs/splice.c:834
 do_splice_from fs/splice.c:846 [inline]
 direct_splice_actor+0x1fd/0x580 fs/splice.c:1016
 splice_direct_to_actor+0x6b2/0xf50 fs/splice.c:971
 do_splice_direct+0x342/0x580 fs/splice.c:1059
 do_sendfile+0x101b/0x1d40 fs/read_write.c:1540
 __do_sys_sendfile64 fs/read_write.c:1601 [inline]
 __se_sys_sendfile64+0x2bb/0x360 fs/read_write.c:1587
 __x64_sys_sendfile64+0x56/0x70 fs/read_write.c:1587
 do_syscall_64+0xb0/0x150 arch/x86/entry/common.c:386
 entry_SYSCALL_64_after_hwframe+0x44/0xa9
RIP: 0033:0x446ea9
Code: Bad RIP value.
RSP: 002b:00007f7e8fc20d08 EFLAGS: 00000246 ORIG_RAX: 0000000000000028
RAX: ffffffffffffffda RBX: 00000000006dcc48 RCX: 0000000000446ea9
RDX: 0000000000000000 RSI: 0000000000000004 RDI: 0000000000000005
RBP: 00000000006dcc40 R08: 65732f636f72702f R09: 65732f636f72702f
R10: 0000000000000008 R11: 0000000000000246 R12: 00000000006dcc4c
R13: 00007f7e8fc20d10 R14: 00007f7e8fc20d10 R15: 0000000068736168

Uninit was stored to memory at:
 kmsan_save_stack_with_flags mm/kmsan/kmsan.c:144 [inline]
 kmsan_internal_chain_origin+0xad/0x130 mm/kmsan/kmsan.c:310
 __msan_chain_origin+0x50/0x90 mm/kmsan/kmsan_instr.c:165
 __crypto_xor+0x1eb/0x1470 crypto/algapi.c:1000
 crypto_xor include/crypto/algapi.h:152 [inline]
 crypto_cmac_digest_final+0x505/0x590 crypto/cmac.c:193
 crypto_shash_final+0x394/0x450 crypto/shash.c:160
 shash_finup_unaligned+0x120/0x160 crypto/shash.c:168
 crypto_shash_finup+0x2b4/0x6b0 crypto/shash.c:181
 shash_digest_unaligned+0x22b/0x260 crypto/shash.c:189
 crypto_shash_digest crypto/shash.c:205 [inline]
 shash_ahash_digest+0x788/0x8a0 crypto/shash.c:322
 shash_async_digest+0xbb/0x110 crypto/shash.c:340
 crypto_ahash_op+0x1c6/0x6c0 crypto/ahash.c:370
 crypto_ahash_digest+0xdc/0x150 crypto/ahash.c:412
 hash_sendpage+0x9cc/0xdf0 crypto/algif_hash.c:159
 kernel_sendpage net/socket.c:3642 [inline]
 sock_sendpage+0x1e1/0x2c0 net/socket.c:945
 pipe_to_sendpage+0x38c/0x4c0 fs/splice.c:448
 splice_from_pipe_feed fs/splice.c:502 [inline]
 __splice_from_pipe+0x565/0xf00 fs/splice.c:626
 splice_from_pipe fs/splice.c:661 [inline]
 generic_splice_sendpage+0x1d5/0x2d0 fs/splice.c:834
 do_splice_from fs/splice.c:846 [inline]
 direct_splice_actor+0x1fd/0x580 fs/splice.c:1016
 splice_direct_to_actor+0x6b2/0xf50 fs/splice.c:971
 do_splice_direct+0x342/0x580 fs/splice.c:1059
 do_sendfile+0x101b/0x1d40 fs/read_write.c:1540
 __do_sys_sendfile64 fs/read_write.c:1601 [inline]
 __se_sys_sendfile64+0x2bb/0x360 fs/read_write.c:1587
 __x64_sys_sendfile64+0x56/0x70 fs/read_write.c:1587
 do_syscall_64+0xb0/0x150 arch/x86/entry/common.c:386
 entry_SYSCALL_64_after_hwframe+0x44/0xa9

Uninit was stored to memory at:
 kmsan_save_stack_with_flags mm/kmsan/kmsan.c:144 [inline]
 kmsan_internal_chain_origin+0xad/0x130 mm/kmsan/kmsan.c:310
 __msan_chain_origin+0x50/0x90 mm/kmsan/kmsan_instr.c:165
 __crypto_xor+0x1eb/0x1470 crypto/algapi.c:1000
 crypto_xor include/crypto/algapi.h:152 [inline]
 crypto_cmac_digest_final+0x49f/0x590 crypto/cmac.c:192
 crypto_shash_final+0x394/0x450 crypto/shash.c:160
 shash_finup_unaligned+0x120/0x160 crypto/shash.c:168
 crypto_shash_finup+0x2b4/0x6b0 crypto/shash.c:181
 shash_digest_unaligned+0x22b/0x260 crypto/shash.c:189
 crypto_shash_digest crypto/shash.c:205 [inline]
 shash_ahash_digest+0x788/0x8a0 crypto/shash.c:322
 shash_async_digest+0xbb/0x110 crypto/shash.c:340
 crypto_ahash_op+0x1c6/0x6c0 crypto/ahash.c:370
 crypto_ahash_digest+0xdc/0x150 crypto/ahash.c:412
 hash_sendpage+0x9cc/0xdf0 crypto/algif_hash.c:159
 kernel_sendpage net/socket.c:3642 [inline]
 sock_sendpage+0x1e1/0x2c0 net/socket.c:945
 pipe_to_sendpage+0x38c/0x4c0 fs/splice.c:448
 splice_from_pipe_feed fs/splice.c:502 [inline]
 __splice_from_pipe+0x565/0xf00 fs/splice.c:626
 splice_from_pipe fs/splice.c:661 [inline]
 generic_splice_sendpage+0x1d5/0x2d0 fs/splice.c:834
 do_splice_from fs/splice.c:846 [inline]
 direct_splice_actor+0x1fd/0x580 fs/splice.c:1016
 splice_direct_to_actor+0x6b2/0xf50 fs/splice.c:971
 do_splice_direct+0x342/0x580 fs/splice.c:1059
 do_sendfile+0x101b/0x1d40 fs/read_write.c:1540
 __do_sys_sendfile64 fs/read_write.c:1601 [inline]
 __se_sys_sendfile64+0x2bb/0x360 fs/read_write.c:1587
 __x64_sys_sendfile64+0x56/0x70 fs/read_write.c:1587
 do_syscall_64+0xb0/0x150 arch/x86/entry/common.c:386
 entry_SYSCALL_64_after_hwframe+0x44/0xa9

Uninit was stored to memory at:
 kmsan_save_stack_with_flags mm/kmsan/kmsan.c:144 [inline]
 kmsan_internal_chain_origin+0xad/0x130 mm/kmsan/kmsan.c:310
 kmsan_memcpy_memmove_metadata+0x272/0x2e0 mm/kmsan/kmsan.c:247
 kmsan_memcpy_metadata+0xb/0x10 mm/kmsan/kmsan.c:267
 __msan_memcpy+0x43/0x50 mm/kmsan/kmsan_instr.c:116
 crypto_cmac_digest_update+0x597/0x7f0 crypto/cmac.c:131
 crypto_shash_update+0x4e9/0x550 crypto/shash.c:106
 shash_finup_unaligned+0xab/0x160 crypto/shash.c:167
 crypto_shash_finup+0x2b4/0x6b0 crypto/shash.c:181
 shash_digest_unaligned+0x22b/0x260 crypto/shash.c:189
 crypto_shash_digest crypto/shash.c:205 [inline]
 shash_ahash_digest+0x788/0x8a0 crypto/shash.c:322
 shash_async_digest+0xbb/0x110 crypto/shash.c:340
 crypto_ahash_op+0x1c6/0x6c0 crypto/ahash.c:370
 crypto_ahash_digest+0xdc/0x150 crypto/ahash.c:412
 hash_sendpage+0x9cc/0xdf0 crypto/algif_hash.c:159
 kernel_sendpage net/socket.c:3642 [inline]
 sock_sendpage+0x1e1/0x2c0 net/socket.c:945
 pipe_to_sendpage+0x38c/0x4c0 fs/splice.c:448
 splice_from_pipe_feed fs/splice.c:502 [inline]
 __splice_from_pipe+0x565/0xf00 fs/splice.c:626
 splice_from_pipe fs/splice.c:661 [inline]
 generic_splice_sendpage+0x1d5/0x2d0 fs/splice.c:834
 do_splice_from fs/splice.c:846 [inline]
 direct_splice_actor+0x1fd/0x580 fs/splice.c:1016
 splice_direct_to_actor+0x6b2/0xf50 fs/splice.c:971
 do_splice_direct+0x342/0x580 fs/splice.c:1059
 do_sendfile+0x101b/0x1d40 fs/read_write.c:1540
 __do_sys_sendfile64 fs/read_write.c:1601 [inline]
 __se_sys_sendfile64+0x2bb/0x360 fs/read_write.c:1587
 __x64_sys_sendfile64+0x56/0x70 fs/read_write.c:1587
 do_syscall_64+0xb0/0x150 arch/x86/entry/common.c:386
 entry_SYSCALL_64_after_hwframe+0x44/0xa9

Uninit was created at:
 kmsan_save_stack_with_flags+0x3c/0x90 mm/kmsan/kmsan.c:144
 kmsan_internal_alloc_meta_for_pages mm/kmsan/kmsan_shadow.c:269 [inline]
 kmsan_alloc_page+0xb9/0x180 mm/kmsan/kmsan_shadow.c:293
 __alloc_pages_nodemask+0x56a2/0x5dc0 mm/page_alloc.c:4889
 alloc_pages_current+0x672/0x990 mm/mempolicy.c:2292
 alloc_pages include/linux/gfp.h:545 [inline]
 push_pipe+0x605/0xb70 lib/iov_iter.c:537
 __pipe_get_pages lib/iov_iter.c:1278 [inline]
 pipe_get_pages_alloc lib/iov_iter.c:1385 [inline]
 iov_iter_get_pages_alloc+0x18a9/0x21c0 lib/iov_iter.c:1403
 default_file_splice_read fs/splice.c:385 [inline]
 do_splice_to+0x4fc/0x14f0 fs/splice.c:871
 splice_direct_to_actor+0x45c/0xf50 fs/splice.c:950
 do_splice_direct+0x342/0x580 fs/splice.c:1059
 do_sendfile+0x101b/0x1d40 fs/read_write.c:1540
 __do_sys_sendfile64 fs/read_write.c:1601 [inline]
 __se_sys_sendfile64+0x2bb/0x360 fs/read_write.c:1587
 __x64_sys_sendfile64+0x56/0x70 fs/read_write.c:1587
 do_syscall_64+0xb0/0x150 arch/x86/entry/common.c:386
 entry_SYSCALL_64_after_hwframe+0x44/0xa9
=====================================================

Crashes (2):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2020/07/19 01:31 https://github.com/google/kmsan.git master 14525656779e 9c812472 .config console log report syz C ci-upstream-kmsan-gce
2020/07/18 08:21 https://github.com/google/kmsan.git master 14525656779e 9c812472 .config console log report ci-upstream-kmsan-gce
* Struck through repros no longer work on HEAD.