public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [syzbot] [crypto?] KMSAN: uninit-value in aes_encrypt (6)
@ 2025-10-11  9:38 syzbot
  2025-10-11 14:52 ` Ard Biesheuvel
  0 siblings, 1 reply; 3+ messages in thread
From: syzbot @ 2025-10-11  9:38 UTC (permalink / raw)
  To: davem, herbert, linux-crypto, linux-kernel, syzkaller-bugs

Hello,

syzbot found the following issue on:

HEAD commit:    917167ed1211 Merge tag 'xtensa-20251010' of https://github..
git tree:       upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=10f55304580000
kernel config:  https://syzkaller.appspot.com/x/.config?x=3b820eb4c6dd8482
dashboard link: https://syzkaller.appspot.com/bug?extid=22bff16a8f91d65e2e58
compiler:       Debian clang version 20.1.8 (++20250708063551+0c9f909b7976-1~exp1~20250708183702.136), Debian LLD 20.1.8
userspace arch: i386

Unfortunately, I don't have any reproducer for this issue yet.

Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/f8b165efe52b/disk-917167ed.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/01b56300cdc7/vmlinux-917167ed.xz
kernel image: https://storage.googleapis.com/syzbot-assets/6c32d21e8075/bzImage-917167ed.xz

IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+22bff16a8f91d65e2e58@syzkaller.appspotmail.com

EXT4-fs error (device loop5): ext4_orphan_get:1418: comm syz.5.10451: bad orphan inode 131083
EXT4-fs (loop5): mounted filesystem 00000000-0000-0000-0000-000000000000 r/w without journal. Quota mode: none.
=====================================================
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
 crypto_ecb_crypt crypto/ecb.c:23 [inline]
 crypto_ecb_encrypt2+0x13f/0x300 crypto/ecb.c:40
 crypto_lskcipher_crypt_sg+0x3a9/0x930 crypto/lskcipher.c:188
 crypto_lskcipher_encrypt_sg+0x8b/0xc0 crypto/lskcipher.c:207
 crypto_skcipher_encrypt+0x111/0x1e0 crypto/skcipher.c:194
 xts_encrypt+0x2e1/0x570 crypto/xts.c:269
 crypto_skcipher_encrypt+0x187/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_process_page_bufs+0xf1b/0x13e0 fs/ext4/inode.c:2191
 mpage_prepare_extent_to_map+0x1792/0x2a10 fs/ext4/inode.c:2736
 ext4_do_writepages+0x11b6/0x8020 fs/ext4/inode.c:2877
 ext4_writepages+0x338/0x870 fs/ext4/inode.c:3025
 do_writepages+0x3ef/0x860 mm/page-writeback.c:2604
 filemap_fdatawrite_wbc mm/filemap.c:389 [inline]
 __filemap_fdatawrite_range mm/filemap.c:422 [inline]
 file_write_and_wait_range+0x6f0/0x7d0 mm/filemap.c:797
 generic_buffers_fsync_noflush+0x79/0x3c0 fs/buffer.c:609
 ext4_fsync_nojournal fs/ext4/fsync.c:88 [inline]
 ext4_sync_file+0x587/0x12f0 fs/ext4/fsync.c:147
 vfs_fsync_range+0x1a1/0x240 fs/sync.c:187
 generic_write_sync include/linux/fs.h:3046 [inline]
 ext4_buffered_write_iter+0xae9/0xce0 fs/ext4/file.c:305
 ext4_file_write_iter+0x2a2/0x3d90 fs/ext4/file.c:-1
 do_iter_readv_writev+0x9de/0xc20 fs/read_write.c:-1
 vfs_writev+0x52a/0x1500 fs/read_write.c:1057
 do_pwritev fs/read_write.c:1153 [inline]
 __do_compat_sys_pwritev2 fs/read_write.c:1298 [inline]
 __se_compat_sys_pwritev2 fs/read_write.c:1290 [inline]
 __ia32_compat_sys_pwritev2+0x43d/0x6b0 fs/read_write.c:1290
 ia32_sys_call+0x1810/0x4310 arch/x86/include/generated/asm/syscalls_32.h:380
 do_syscall_32_irqs_on arch/x86/entry/syscall_32.c:83 [inline]
 __do_fast_syscall_32+0xb0/0x150 arch/x86/entry/syscall_32.c:306
 do_fast_syscall_32+0x38/0x80 arch/x86/entry/syscall_32.c:331
 do_SYSENTER_32+0x1f/0x30 arch/x86/entry/syscall_32.c:369
 entry_SYSENTER_compat_after_hwframe+0x84/0x8e

Uninit was stored to memory at:
 le128_xor include/crypto/b128ops.h:69 [inline]
 xts_xor_tweak+0x566/0xbd0 crypto/xts.c:123
 xts_xor_tweak_pre crypto/xts.c:135 [inline]
 xts_encrypt+0x278/0x570 crypto/xts.c:268
 crypto_skcipher_encrypt+0x187/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_process_page_bufs+0xf1b/0x13e0 fs/ext4/inode.c:2191
 mpage_prepare_extent_to_map+0x1792/0x2a10 fs/ext4/inode.c:2736
 ext4_do_writepages+0x11b6/0x8020 fs/ext4/inode.c:2877
 ext4_writepages+0x338/0x870 fs/ext4/inode.c:3025
 do_writepages+0x3ef/0x860 mm/page-writeback.c:2604
 filemap_fdatawrite_wbc mm/filemap.c:389 [inline]
 __filemap_fdatawrite_range mm/filemap.c:422 [inline]
 file_write_and_wait_range+0x6f0/0x7d0 mm/filemap.c:797
 generic_buffers_fsync_noflush+0x79/0x3c0 fs/buffer.c:609
 ext4_fsync_nojournal fs/ext4/fsync.c:88 [inline]
 ext4_sync_file+0x587/0x12f0 fs/ext4/fsync.c:147
 vfs_fsync_range+0x1a1/0x240 fs/sync.c:187
 generic_write_sync include/linux/fs.h:3046 [inline]
 ext4_buffered_write_iter+0xae9/0xce0 fs/ext4/file.c:305
 ext4_file_write_iter+0x2a2/0x3d90 fs/ext4/file.c:-1
 do_iter_readv_writev+0x9de/0xc20 fs/read_write.c:-1
 vfs_writev+0x52a/0x1500 fs/read_write.c:1057
 do_pwritev fs/read_write.c:1153 [inline]
 __do_compat_sys_pwritev2 fs/read_write.c:1298 [inline]
 __se_compat_sys_pwritev2 fs/read_write.c:1290 [inline]
 __ia32_compat_sys_pwritev2+0x43d/0x6b0 fs/read_write.c:1290
 ia32_sys_call+0x1810/0x4310 arch/x86/include/generated/asm/syscalls_32.h:380
 do_syscall_32_irqs_on arch/x86/entry/syscall_32.c:83 [inline]
 __do_fast_syscall_32+0xb0/0x150 arch/x86/entry/syscall_32.c:306
 do_fast_syscall_32+0x38/0x80 arch/x86/entry/syscall_32.c:331
 do_SYSENTER_32+0x1f/0x30 arch/x86/entry/syscall_32.c:369
 entry_SYSENTER_compat_after_hwframe+0x84/0x8e

Uninit was created at:
 __alloc_frozen_pages_noprof+0x689/0xf00 mm/page_alloc.c:5206
 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
 generic_perform_write+0x362/0x1050 mm/filemap.c:4242
 ext4_buffered_write_iter+0x61a/0xce0 fs/ext4/file.c:299
 ext4_file_write_iter+0x2a2/0x3d90 fs/ext4/file.c:-1
 do_iter_readv_writev+0x9de/0xc20 fs/read_write.c:-1
 vfs_writev+0x52a/0x1500 fs/read_write.c:1057
 do_pwritev fs/read_write.c:1153 [inline]
 __do_compat_sys_pwritev2 fs/read_write.c:1298 [inline]
 __se_compat_sys_pwritev2 fs/read_write.c:1290 [inline]
 __ia32_compat_sys_pwritev2+0x43d/0x6b0 fs/read_write.c:1290
 ia32_sys_call+0x1810/0x4310 arch/x86/include/generated/asm/syscalls_32.h:380
 do_syscall_32_irqs_on arch/x86/entry/syscall_32.c:83 [inline]
 __do_fast_syscall_32+0xb0/0x150 arch/x86/entry/syscall_32.c:306
 do_fast_syscall_32+0x38/0x80 arch/x86/entry/syscall_32.c:331
 do_SYSENTER_32+0x1f/0x30 arch/x86/entry/syscall_32.c:369
 entry_SYSENTER_compat_after_hwframe+0x84/0x8e

CPU: 1 UID: 0 PID: 8113 Comm: syz.5.10451 Tainted: G        W           syzkaller #0 PREEMPT(none) 
Tainted: [W]=WARN
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/02/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@googlegroups.com.

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [syzbot] [crypto?] KMSAN: uninit-value in aes_encrypt (6)
  2025-10-11  9:38 [syzbot] [crypto?] KMSAN: uninit-value in aes_encrypt (6) syzbot
@ 2025-10-11 14:52 ` Ard Biesheuvel
  2025-10-14 14:57   ` Aleksandr Nogikh
  0 siblings, 1 reply; 3+ messages in thread
From: Ard Biesheuvel @ 2025-10-11 14:52 UTC (permalink / raw)
  To: syzbot; +Cc: davem, herbert, linux-crypto, linux-kernel, syzkaller-bugs

#syz set subsystems: ext4, fscrypt

On Sat, 11 Oct 2025 at 02:38, syzbot
<syzbot+22bff16a8f91d65e2e58@syzkaller.appspotmail.com> wrote:
>
> Hello,
>
> syzbot found the following issue on:
>
> HEAD commit:    917167ed1211 Merge tag 'xtensa-20251010' of https://github..
> git tree:       upstream
> console output: https://syzkaller.appspot.com/x/log.txt?x=10f55304580000
> kernel config:  https://syzkaller.appspot.com/x/.config?x=3b820eb4c6dd8482
> dashboard link: https://syzkaller.appspot.com/bug?extid=22bff16a8f91d65e2e58
> compiler:       Debian clang version 20.1.8 (++20250708063551+0c9f909b7976-1~exp1~20250708183702.136), Debian LLD 20.1.8
> userspace arch: i386
>
> Unfortunately, I don't have any reproducer for this issue yet.
>
> Downloadable assets:
> disk image: https://storage.googleapis.com/syzbot-assets/f8b165efe52b/disk-917167ed.raw.xz
> vmlinux: https://storage.googleapis.com/syzbot-assets/01b56300cdc7/vmlinux-917167ed.xz
> kernel image: https://storage.googleapis.com/syzbot-assets/6c32d21e8075/bzImage-917167ed.xz
>
> IMPORTANT: if you fix the issue, please add the following tag to the commit:
> Reported-by: syzbot+22bff16a8f91d65e2e58@syzkaller.appspotmail.com
>
> EXT4-fs error (device loop5): ext4_orphan_get:1418: comm syz.5.10451: bad orphan inode 131083
> EXT4-fs (loop5): mounted filesystem 00000000-0000-0000-0000-000000000000 r/w without journal. Quota mode: none.
> =====================================================
> 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
>  crypto_ecb_crypt crypto/ecb.c:23 [inline]
>  crypto_ecb_encrypt2+0x13f/0x300 crypto/ecb.c:40
>  crypto_lskcipher_crypt_sg+0x3a9/0x930 crypto/lskcipher.c:188
>  crypto_lskcipher_encrypt_sg+0x8b/0xc0 crypto/lskcipher.c:207
>  crypto_skcipher_encrypt+0x111/0x1e0 crypto/skcipher.c:194
>  xts_encrypt+0x2e1/0x570 crypto/xts.c:269
>  crypto_skcipher_encrypt+0x187/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_process_page_bufs+0xf1b/0x13e0 fs/ext4/inode.c:2191
>  mpage_prepare_extent_to_map+0x1792/0x2a10 fs/ext4/inode.c:2736
>  ext4_do_writepages+0x11b6/0x8020 fs/ext4/inode.c:2877
>  ext4_writepages+0x338/0x870 fs/ext4/inode.c:3025
>  do_writepages+0x3ef/0x860 mm/page-writeback.c:2604
>  filemap_fdatawrite_wbc mm/filemap.c:389 [inline]
>  __filemap_fdatawrite_range mm/filemap.c:422 [inline]
>  file_write_and_wait_range+0x6f0/0x7d0 mm/filemap.c:797
>  generic_buffers_fsync_noflush+0x79/0x3c0 fs/buffer.c:609
>  ext4_fsync_nojournal fs/ext4/fsync.c:88 [inline]
>  ext4_sync_file+0x587/0x12f0 fs/ext4/fsync.c:147
>  vfs_fsync_range+0x1a1/0x240 fs/sync.c:187
>  generic_write_sync include/linux/fs.h:3046 [inline]
>  ext4_buffered_write_iter+0xae9/0xce0 fs/ext4/file.c:305
>  ext4_file_write_iter+0x2a2/0x3d90 fs/ext4/file.c:-1
>  do_iter_readv_writev+0x9de/0xc20 fs/read_write.c:-1
>  vfs_writev+0x52a/0x1500 fs/read_write.c:1057
>  do_pwritev fs/read_write.c:1153 [inline]
>  __do_compat_sys_pwritev2 fs/read_write.c:1298 [inline]
>  __se_compat_sys_pwritev2 fs/read_write.c:1290 [inline]
>  __ia32_compat_sys_pwritev2+0x43d/0x6b0 fs/read_write.c:1290
>  ia32_sys_call+0x1810/0x4310 arch/x86/include/generated/asm/syscalls_32.h:380
>  do_syscall_32_irqs_on arch/x86/entry/syscall_32.c:83 [inline]
>  __do_fast_syscall_32+0xb0/0x150 arch/x86/entry/syscall_32.c:306
>  do_fast_syscall_32+0x38/0x80 arch/x86/entry/syscall_32.c:331
>  do_SYSENTER_32+0x1f/0x30 arch/x86/entry/syscall_32.c:369
>  entry_SYSENTER_compat_after_hwframe+0x84/0x8e
>
> Uninit was stored to memory at:
>  le128_xor include/crypto/b128ops.h:69 [inline]
>  xts_xor_tweak+0x566/0xbd0 crypto/xts.c:123
>  xts_xor_tweak_pre crypto/xts.c:135 [inline]
>  xts_encrypt+0x278/0x570 crypto/xts.c:268
>  crypto_skcipher_encrypt+0x187/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_process_page_bufs+0xf1b/0x13e0 fs/ext4/inode.c:2191
>  mpage_prepare_extent_to_map+0x1792/0x2a10 fs/ext4/inode.c:2736
>  ext4_do_writepages+0x11b6/0x8020 fs/ext4/inode.c:2877
>  ext4_writepages+0x338/0x870 fs/ext4/inode.c:3025
>  do_writepages+0x3ef/0x860 mm/page-writeback.c:2604
>  filemap_fdatawrite_wbc mm/filemap.c:389 [inline]
>  __filemap_fdatawrite_range mm/filemap.c:422 [inline]
>  file_write_and_wait_range+0x6f0/0x7d0 mm/filemap.c:797
>  generic_buffers_fsync_noflush+0x79/0x3c0 fs/buffer.c:609
>  ext4_fsync_nojournal fs/ext4/fsync.c:88 [inline]
>  ext4_sync_file+0x587/0x12f0 fs/ext4/fsync.c:147
>  vfs_fsync_range+0x1a1/0x240 fs/sync.c:187
>  generic_write_sync include/linux/fs.h:3046 [inline]
>  ext4_buffered_write_iter+0xae9/0xce0 fs/ext4/file.c:305
>  ext4_file_write_iter+0x2a2/0x3d90 fs/ext4/file.c:-1
>  do_iter_readv_writev+0x9de/0xc20 fs/read_write.c:-1
>  vfs_writev+0x52a/0x1500 fs/read_write.c:1057
>  do_pwritev fs/read_write.c:1153 [inline]
>  __do_compat_sys_pwritev2 fs/read_write.c:1298 [inline]
>  __se_compat_sys_pwritev2 fs/read_write.c:1290 [inline]
>  __ia32_compat_sys_pwritev2+0x43d/0x6b0 fs/read_write.c:1290
>  ia32_sys_call+0x1810/0x4310 arch/x86/include/generated/asm/syscalls_32.h:380
>  do_syscall_32_irqs_on arch/x86/entry/syscall_32.c:83 [inline]
>  __do_fast_syscall_32+0xb0/0x150 arch/x86/entry/syscall_32.c:306
>  do_fast_syscall_32+0x38/0x80 arch/x86/entry/syscall_32.c:331
>  do_SYSENTER_32+0x1f/0x30 arch/x86/entry/syscall_32.c:369
>  entry_SYSENTER_compat_after_hwframe+0x84/0x8e
>
> Uninit was created at:
>  __alloc_frozen_pages_noprof+0x689/0xf00 mm/page_alloc.c:5206
>  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
>  generic_perform_write+0x362/0x1050 mm/filemap.c:4242
>  ext4_buffered_write_iter+0x61a/0xce0 fs/ext4/file.c:299
>  ext4_file_write_iter+0x2a2/0x3d90 fs/ext4/file.c:-1
>  do_iter_readv_writev+0x9de/0xc20 fs/read_write.c:-1
>  vfs_writev+0x52a/0x1500 fs/read_write.c:1057
>  do_pwritev fs/read_write.c:1153 [inline]
>  __do_compat_sys_pwritev2 fs/read_write.c:1298 [inline]
>  __se_compat_sys_pwritev2 fs/read_write.c:1290 [inline]
>  __ia32_compat_sys_pwritev2+0x43d/0x6b0 fs/read_write.c:1290
>  ia32_sys_call+0x1810/0x4310 arch/x86/include/generated/asm/syscalls_32.h:380
>  do_syscall_32_irqs_on arch/x86/entry/syscall_32.c:83 [inline]
>  __do_fast_syscall_32+0xb0/0x150 arch/x86/entry/syscall_32.c:306
>  do_fast_syscall_32+0x38/0x80 arch/x86/entry/syscall_32.c:331
>  do_SYSENTER_32+0x1f/0x30 arch/x86/entry/syscall_32.c:369
>  entry_SYSENTER_compat_after_hwframe+0x84/0x8e
>
> CPU: 1 UID: 0 PID: 8113 Comm: syz.5.10451 Tainted: G        W           syzkaller #0 PREEMPT(none)
> Tainted: [W]=WARN
> Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/02/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@googlegroups.com.
>
> 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 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
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [syzbot] [crypto?] KMSAN: uninit-value in aes_encrypt (6)
  2025-10-11 14:52 ` Ard Biesheuvel
@ 2025-10-14 14:57   ` Aleksandr Nogikh
  0 siblings, 0 replies; 3+ messages in thread
From: Aleksandr Nogikh @ 2025-10-14 14:57 UTC (permalink / raw)
  To: Ard Biesheuvel
  Cc: syzbot, davem, herbert, linux-crypto, linux-kernel,
	syzkaller-bugs

#syz dup: KMSAN: uninit-value in fscrypt_crypt_data_unit

On Sat, Oct 11, 2025 at 4:53 PM 'Ard Biesheuvel' via syzkaller-bugs
<syzkaller-bugs@googlegroups.com> wrote:
>
> #syz set subsystems: ext4, fscrypt
>
> On Sat, 11 Oct 2025 at 02:38, syzbot
> <syzbot+22bff16a8f91d65e2e58@syzkaller.appspotmail.com> wrote:
> >
> > Hello,
> >
> > syzbot found the following issue on:
> >
> > HEAD commit:    917167ed1211 Merge tag 'xtensa-20251010' of https://github..
> > git tree:       upstream
> > console output: https://syzkaller.appspot.com/x/log.txt?x=10f55304580000
> > kernel config:  https://syzkaller.appspot.com/x/.config?x=3b820eb4c6dd8482
> > dashboard link: https://syzkaller.appspot.com/bug?extid=22bff16a8f91d65e2e58
> > compiler:       Debian clang version 20.1.8 (++20250708063551+0c9f909b7976-1~exp1~20250708183702.136), Debian LLD 20.1.8
> > userspace arch: i386
> >
> > Unfortunately, I don't have any reproducer for this issue yet.
> >
> > Downloadable assets:
> > disk image: https://storage.googleapis.com/syzbot-assets/f8b165efe52b/disk-917167ed.raw.xz
> > vmlinux: https://storage.googleapis.com/syzbot-assets/01b56300cdc7/vmlinux-917167ed.xz
> > kernel image: https://storage.googleapis.com/syzbot-assets/6c32d21e8075/bzImage-917167ed.xz
> >
> > IMPORTANT: if you fix the issue, please add the following tag to the commit:
> > Reported-by: syzbot+22bff16a8f91d65e2e58@syzkaller.appspotmail.com
> >
> > EXT4-fs error (device loop5): ext4_orphan_get:1418: comm syz.5.10451: bad orphan inode 131083
> > EXT4-fs (loop5): mounted filesystem 00000000-0000-0000-0000-000000000000 r/w without journal. Quota mode: none.
> > =====================================================
> > 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
> >  crypto_ecb_crypt crypto/ecb.c:23 [inline]
> >  crypto_ecb_encrypt2+0x13f/0x300 crypto/ecb.c:40
> >  crypto_lskcipher_crypt_sg+0x3a9/0x930 crypto/lskcipher.c:188
> >  crypto_lskcipher_encrypt_sg+0x8b/0xc0 crypto/lskcipher.c:207
> >  crypto_skcipher_encrypt+0x111/0x1e0 crypto/skcipher.c:194
> >  xts_encrypt+0x2e1/0x570 crypto/xts.c:269
> >  crypto_skcipher_encrypt+0x187/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_process_page_bufs+0xf1b/0x13e0 fs/ext4/inode.c:2191
> >  mpage_prepare_extent_to_map+0x1792/0x2a10 fs/ext4/inode.c:2736
> >  ext4_do_writepages+0x11b6/0x8020 fs/ext4/inode.c:2877
> >  ext4_writepages+0x338/0x870 fs/ext4/inode.c:3025
> >  do_writepages+0x3ef/0x860 mm/page-writeback.c:2604
> >  filemap_fdatawrite_wbc mm/filemap.c:389 [inline]
> >  __filemap_fdatawrite_range mm/filemap.c:422 [inline]
> >  file_write_and_wait_range+0x6f0/0x7d0 mm/filemap.c:797
> >  generic_buffers_fsync_noflush+0x79/0x3c0 fs/buffer.c:609
> >  ext4_fsync_nojournal fs/ext4/fsync.c:88 [inline]
> >  ext4_sync_file+0x587/0x12f0 fs/ext4/fsync.c:147
> >  vfs_fsync_range+0x1a1/0x240 fs/sync.c:187
> >  generic_write_sync include/linux/fs.h:3046 [inline]
> >  ext4_buffered_write_iter+0xae9/0xce0 fs/ext4/file.c:305
> >  ext4_file_write_iter+0x2a2/0x3d90 fs/ext4/file.c:-1
> >  do_iter_readv_writev+0x9de/0xc20 fs/read_write.c:-1
> >  vfs_writev+0x52a/0x1500 fs/read_write.c:1057
> >  do_pwritev fs/read_write.c:1153 [inline]
> >  __do_compat_sys_pwritev2 fs/read_write.c:1298 [inline]
> >  __se_compat_sys_pwritev2 fs/read_write.c:1290 [inline]
> >  __ia32_compat_sys_pwritev2+0x43d/0x6b0 fs/read_write.c:1290
> >  ia32_sys_call+0x1810/0x4310 arch/x86/include/generated/asm/syscalls_32.h:380
> >  do_syscall_32_irqs_on arch/x86/entry/syscall_32.c:83 [inline]
> >  __do_fast_syscall_32+0xb0/0x150 arch/x86/entry/syscall_32.c:306
> >  do_fast_syscall_32+0x38/0x80 arch/x86/entry/syscall_32.c:331
> >  do_SYSENTER_32+0x1f/0x30 arch/x86/entry/syscall_32.c:369
> >  entry_SYSENTER_compat_after_hwframe+0x84/0x8e
> >
> > Uninit was stored to memory at:
> >  le128_xor include/crypto/b128ops.h:69 [inline]
> >  xts_xor_tweak+0x566/0xbd0 crypto/xts.c:123
> >  xts_xor_tweak_pre crypto/xts.c:135 [inline]
> >  xts_encrypt+0x278/0x570 crypto/xts.c:268
> >  crypto_skcipher_encrypt+0x187/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_process_page_bufs+0xf1b/0x13e0 fs/ext4/inode.c:2191
> >  mpage_prepare_extent_to_map+0x1792/0x2a10 fs/ext4/inode.c:2736
> >  ext4_do_writepages+0x11b6/0x8020 fs/ext4/inode.c:2877
> >  ext4_writepages+0x338/0x870 fs/ext4/inode.c:3025
> >  do_writepages+0x3ef/0x860 mm/page-writeback.c:2604
> >  filemap_fdatawrite_wbc mm/filemap.c:389 [inline]
> >  __filemap_fdatawrite_range mm/filemap.c:422 [inline]
> >  file_write_and_wait_range+0x6f0/0x7d0 mm/filemap.c:797
> >  generic_buffers_fsync_noflush+0x79/0x3c0 fs/buffer.c:609
> >  ext4_fsync_nojournal fs/ext4/fsync.c:88 [inline]
> >  ext4_sync_file+0x587/0x12f0 fs/ext4/fsync.c:147
> >  vfs_fsync_range+0x1a1/0x240 fs/sync.c:187
> >  generic_write_sync include/linux/fs.h:3046 [inline]
> >  ext4_buffered_write_iter+0xae9/0xce0 fs/ext4/file.c:305
> >  ext4_file_write_iter+0x2a2/0x3d90 fs/ext4/file.c:-1
> >  do_iter_readv_writev+0x9de/0xc20 fs/read_write.c:-1
> >  vfs_writev+0x52a/0x1500 fs/read_write.c:1057
> >  do_pwritev fs/read_write.c:1153 [inline]
> >  __do_compat_sys_pwritev2 fs/read_write.c:1298 [inline]
> >  __se_compat_sys_pwritev2 fs/read_write.c:1290 [inline]
> >  __ia32_compat_sys_pwritev2+0x43d/0x6b0 fs/read_write.c:1290
> >  ia32_sys_call+0x1810/0x4310 arch/x86/include/generated/asm/syscalls_32.h:380
> >  do_syscall_32_irqs_on arch/x86/entry/syscall_32.c:83 [inline]
> >  __do_fast_syscall_32+0xb0/0x150 arch/x86/entry/syscall_32.c:306
> >  do_fast_syscall_32+0x38/0x80 arch/x86/entry/syscall_32.c:331
> >  do_SYSENTER_32+0x1f/0x30 arch/x86/entry/syscall_32.c:369
> >  entry_SYSENTER_compat_after_hwframe+0x84/0x8e
> >
> > Uninit was created at:
> >  __alloc_frozen_pages_noprof+0x689/0xf00 mm/page_alloc.c:5206
> >  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
> >  generic_perform_write+0x362/0x1050 mm/filemap.c:4242
> >  ext4_buffered_write_iter+0x61a/0xce0 fs/ext4/file.c:299
> >  ext4_file_write_iter+0x2a2/0x3d90 fs/ext4/file.c:-1
> >  do_iter_readv_writev+0x9de/0xc20 fs/read_write.c:-1
> >  vfs_writev+0x52a/0x1500 fs/read_write.c:1057
> >  do_pwritev fs/read_write.c:1153 [inline]
> >  __do_compat_sys_pwritev2 fs/read_write.c:1298 [inline]
> >  __se_compat_sys_pwritev2 fs/read_write.c:1290 [inline]
> >  __ia32_compat_sys_pwritev2+0x43d/0x6b0 fs/read_write.c:1290
> >  ia32_sys_call+0x1810/0x4310 arch/x86/include/generated/asm/syscalls_32.h:380
> >  do_syscall_32_irqs_on arch/x86/entry/syscall_32.c:83 [inline]
> >  __do_fast_syscall_32+0xb0/0x150 arch/x86/entry/syscall_32.c:306
> >  do_fast_syscall_32+0x38/0x80 arch/x86/entry/syscall_32.c:331
> >  do_SYSENTER_32+0x1f/0x30 arch/x86/entry/syscall_32.c:369
> >  entry_SYSENTER_compat_after_hwframe+0x84/0x8e
> >
> > CPU: 1 UID: 0 PID: 8113 Comm: syz.5.10451 Tainted: G        W           syzkaller #0 PREEMPT(none)
> > Tainted: [W]=WARN
> > Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/02/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@googlegroups.com.
> >
> > 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 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
> >
>
> --
> You received this message because you are subscribed to the Google Groups "syzkaller-bugs" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to syzkaller-bugs+unsubscribe@googlegroups.com.
> To view this discussion visit https://groups.google.com/d/msgid/syzkaller-bugs/CAMj1kXErR15QWWZXFXjmXgRrxG0Fj_Qjk7OQzbUU%2BoR7g27RLw%40mail.gmail.com.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-10-14 14:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-11  9:38 [syzbot] [crypto?] KMSAN: uninit-value in aes_encrypt (6) syzbot
2025-10-11 14:52 ` Ard Biesheuvel
2025-10-14 14:57   ` Aleksandr Nogikh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox