Kernel bug: KMSAN: uninit-value in adiantum_crypt
Subsystem: crypto
Status: open

Crash report:
=====================================================
BUG: KMSAN: uninit-value in subshift lib/crypto/aes.c:150 [inline]
BUG: KMSAN: uninit-value in aes_encrypt+0x1239/0x1960 lib/crypto/aes.c:283
 subshift lib/crypto/aes.c:150 [inline]
 aes_encrypt+0x1239/0x1960 lib/crypto/aes.c:283
 aesti_encrypt+0x7d/0xf0 crypto/aes_ti.c:31
 cipher_crypt_one+0x120/0x2e0 crypto/cipher.c:75
 crypto_cipher_encrypt_one+0x33/0x40 crypto/cipher.c:82
 adiantum_crypt+0x939/0xe60 crypto/adiantum.c:383
 adiantum_encrypt+0x33/0x40 crypto/adiantum.c:419
 crypto_skcipher_encrypt+0x18a/0x1e0 crypto/skcipher.c:195
 fscrypt_crypt_data_unit+0x38e/0x590 fs/crypto/crypto.c:139
 fscrypt_encrypt_pagecache_blocks+0x430/0x900 fs/crypto/crypto.c:197
 ext4_bio_write_folio+0x1383/0x30d0 fs/ext4/page-io.c:552
 mpage_submit_folio fs/ext4/inode.c:2080 [inline]
 mpage_map_and_submit_buffers fs/ext4/inode.c:2324 [inline]
 mpage_map_and_submit_extent fs/ext4/inode.c:2514 [inline]
 ext4_do_writepages+0x3c08/0x8020 fs/ext4/inode.c:2931
 ext4_writepages+0x338/0x870 fs/ext4/inode.c:3025
 do_writepages+0x3f2/0x860 mm/page-writeback.c:2604
 __writeback_single_inode+0x101/0x1190 fs/fs-writeback.c:1719
 writeback_sb_inodes+0xac1/0x1cb0 fs/fs-writeback.c:2015
 wb_writeback+0x4ce/0xc00 fs/fs-writeback.c:2195
 wb_do_writeback fs/fs-writeback.c:2342 [inline]
 wb_workfn+0x397/0x1910 fs/fs-writeback.c:2382
 process_one_work kernel/workqueue.c:3263 [inline]
 process_scheduled_works+0xb91/0x1d80 kernel/workqueue.c:3346
 worker_thread+0xedf/0x1590 kernel/workqueue.c:3427
 kthread+0xd5c/0xf00 kernel/kthread.c:463
 ret_from_fork+0x1f5/0x4c0 arch/x86/kernel/process.c:158
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245

Uninit was stored to memory at:
 le128_add crypto/adiantum.c:191 [inline]
 adiantum_crypt+0xcf7/0xe60 crypto/adiantum.c:379
 adiantum_encrypt+0x33/0x40 crypto/adiantum.c:419
 crypto_skcipher_encrypt+0x18a/0x1e0 crypto/skcipher.c:195
 fscrypt_crypt_data_unit+0x38e/0x590 fs/crypto/crypto.c:139
 fscrypt_encrypt_pagecache_blocks+0x430/0x900 fs/crypto/crypto.c:197
 ext4_bio_write_folio+0x1383/0x30d0 fs/ext4/page-io.c:552
 mpage_submit_folio fs/ext4/inode.c:2080 [inline]
 mpage_map_and_submit_buffers fs/ext4/inode.c:2324 [inline]
 mpage_map_and_submit_extent fs/ext4/inode.c:2514 [inline]
 ext4_do_writepages+0x3c08/0x8020 fs/ext4/inode.c:2931
 ext4_writepages+0x338/0x870 fs/ext4/inode.c:3025
 do_writepages+0x3f2/0x860 mm/page-writeback.c:2604
 __writeback_single_inode+0x101/0x1190 fs/fs-writeback.c:1719
 writeback_sb_inodes+0xac1/0x1cb0 fs/fs-writeback.c:2015
 wb_writeback+0x4ce/0xc00 fs/fs-writeback.c:2195
 wb_do_writeback fs/fs-writeback.c:2342 [inline]
 wb_workfn+0x397/0x1910 fs/fs-writeback.c:2382
 process_one_work kernel/workqueue.c:3263 [inline]
 process_scheduled_works+0xb91/0x1d80 kernel/workqueue.c:3346
 worker_thread+0xedf/0x1590 kernel/workqueue.c:3427
 kthread+0xd5c/0xf00 kernel/kthread.c:463
 ret_from_fork+0x1f5/0x4c0 arch/x86/kernel/process.c:158
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245

Uninit was stored to memory at:
 adiantum_crypt+0x531/0xe60 crypto/adiantum.c:368
 adiantum_encrypt+0x33/0x40 crypto/adiantum.c:419
 crypto_skcipher_encrypt+0x18a/0x1e0 crypto/skcipher.c:195
 fscrypt_crypt_data_unit+0x38e/0x590 fs/crypto/crypto.c:139
 fscrypt_encrypt_pagecache_blocks+0x430/0x900 fs/crypto/crypto.c:197
 ext4_bio_write_folio+0x1383/0x30d0 fs/ext4/page-io.c:552
 mpage_submit_folio fs/ext4/inode.c:2080 [inline]
 mpage_map_and_submit_buffers fs/ext4/inode.c:2324 [inline]
 mpage_map_and_submit_extent fs/ext4/inode.c:2514 [inline]
 ext4_do_writepages+0x3c08/0x8020 fs/ext4/inode.c:2931
 ext4_writepages+0x338/0x870 fs/ext4/inode.c:3025
 do_writepages+0x3f2/0x860 mm/page-writeback.c:2604
 __writeback_single_inode+0x101/0x1190 fs/fs-writeback.c:1719
 writeback_sb_inodes+0xac1/0x1cb0 fs/fs-writeback.c:2015
 wb_writeback+0x4ce/0xc00 fs/fs-writeback.c:2195
 wb_do_writeback fs/fs-writeback.c:2342 [inline]
 wb_workfn+0x397/0x1910 fs/fs-writeback.c:2382
 process_one_work kernel/workqueue.c:3263 [inline]
 process_scheduled_works+0xb91/0x1d80 kernel/workqueue.c:3346
 worker_thread+0xedf/0x1590 kernel/workqueue.c:3427
 kthread+0xd5c/0xf00 kernel/kthread.c:463
 ret_from_fork+0x1f5/0x4c0 arch/x86/kernel/process.c:158
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245

Uninit was created at:
 __alloc_frozen_pages_noprof+0x689/0xf00 mm/page_alloc.c:5201
 alloc_pages_mpol+0x328/0x860 mm/mempolicy.c:2416
 alloc_frozen_pages_noprof mm/mempolicy.c:2487 [inline]
 alloc_pages_noprof mm/mempolicy.c:2507 [inline]
 folio_alloc_noprof+0x109/0x360 mm/mempolicy.c:2517
 filemap_alloc_folio_noprof+0x9d/0x420 mm/filemap.c:1020
 __filemap_get_folio+0xb45/0x1930 mm/filemap.c:2012
 write_begin_get_folio include/linux/pagemap.h:784 [inline]
 ext4_write_begin+0x6d9/0x2d70 fs/ext4/inode.c:1318
 ext4_da_write_begin+0x77c/0x1490 fs/ext4/inode.c:3129
 generic_perform_write+0x365/0x1050 mm/filemap.c:4255
 ext4_buffered_write_iter+0x61a/0xce0 fs/ext4/file.c:299
 ext4_file_write_iter+0x2a2/0x3d90 fs/ext4/file.c:-1
 new_sync_write fs/read_write.c:593 [inline]
 vfs_write+0xbe2/0x15d0 fs/read_write.c:686
 ksys_pwrite64 fs/read_write.c:793 [inline]
 __do_sys_pwrite64 fs/read_write.c:801 [inline]
 __se_sys_pwrite64 fs/read_write.c:798 [inline]
 __x64_sys_pwrite64+0x2ab/0x3b0 fs/read_write.c:798
 x64_sys_call+0xe77/0x3e30 arch/x86/include/generated/asm/syscalls_64.h:19
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0xd9/0xfa0 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

CPU: 1 UID: 0 PID: 3651 Comm: kworker/u8:15 Not tainted syzkaller #0 PREEMPT(none) 
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/25/2025
Workqueue: writeback wb_workfn (flush-7:0)
=====================================================