syzbot


KMSAN: uninit-value in zswap_store

Status: fixed on 2024/08/14 03:44
Subsystems: mm
[Documentation on labels]
Reported-by: syzbot+9c1fe13fcb51574b249b@syzkaller.appspotmail.com
Fix commit: 65121eff3e4c ext4: avoid writing unitialized memory to disk in EA inodes
First crash: 120d, last: 58d
Discussions (2)
Title Replies (including bot) Last reply
[PATCH] ext4: Avoid writing unitialized memory to disk in EA inodes 2 (2) 2024/07/11 02:35
[syzbot] [mm?] KMSAN: uninit-value in zswap_store 5 (6) 2024/06/12 15:07
Similar bugs (2)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KMSAN: uninit-value in zswap_store (2) mm 1 36d 32d 0/28 upstream: reported on 2024/08/31 19:27
upstream KMSAN: uninit-value in zswap_frontswap_store mm C 4027 192d 476d 0/28 auto-obsoleted due to no activity on 2024/06/01 21:32

Sample crash report:
=====================================================
BUG: KMSAN: uninit-value in zswap_is_folio_same_filled mm/zswap.c:1371 [inline]
BUG: KMSAN: uninit-value in zswap_store+0x13e7/0x2dd0 mm/zswap.c:1438
 zswap_is_folio_same_filled mm/zswap.c:1371 [inline]
 zswap_store+0x13e7/0x2dd0 mm/zswap.c:1438
 swap_writepage+0x11f/0x470 mm/page_io.c:198
 shmem_writepage+0x1a75/0x1f70 mm/shmem.c:1536
 pageout mm/vmscan.c:680 [inline]
 shrink_folio_list+0x577f/0x7cb0 mm/vmscan.c:1360
 evict_folios+0x9bce/0xbc80 mm/vmscan.c:4580
 try_to_shrink_lruvec+0x13a3/0x1750 mm/vmscan.c:4775
 shrink_one+0x646/0xd20 mm/vmscan.c:4813
 shrink_many mm/vmscan.c:4876 [inline]
 lru_gen_shrink_node mm/vmscan.c:4954 [inline]
 shrink_node+0x451a/0x50f0 mm/vmscan.c:5934
 kswapd_shrink_node mm/vmscan.c:6762 [inline]
 balance_pgdat mm/vmscan.c:6954 [inline]
 kswapd+0x257e/0x4290 mm/vmscan.c:7223
 kthread+0x3dd/0x540 kernel/kthread.c:389
 ret_from_fork+0x6d/0x90 arch/x86/kernel/process.c:147
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244

Uninit was stored to memory at:
 memcpy_from_iter lib/iov_iter.c:73 [inline]
 iterate_bvec include/linux/iov_iter.h:122 [inline]
 iterate_and_advance2 include/linux/iov_iter.h:249 [inline]
 iterate_and_advance include/linux/iov_iter.h:271 [inline]
 __copy_from_iter lib/iov_iter.c:249 [inline]
 copy_page_from_iter_atomic+0x12bb/0x2ae0 lib/iov_iter.c:481
 copy_folio_from_iter_atomic include/linux/uio.h:186 [inline]
 generic_perform_write+0x896/0x12e0 mm/filemap.c:4032
 shmem_file_write_iter+0x2bd/0x2f0 mm/shmem.c:3078
 do_iter_readv_writev+0x8a1/0xa40
 vfs_iter_write+0x459/0xd50 fs/read_write.c:895
 lo_write_bvec drivers/block/loop.c:243 [inline]
 lo_write_simple drivers/block/loop.c:264 [inline]
 do_req_filebacked drivers/block/loop.c:511 [inline]
 loop_handle_cmd drivers/block/loop.c:1910 [inline]
 loop_process_work+0x15ec/0x3750 drivers/block/loop.c:1945
 loop_workfn+0x48/0x60 drivers/block/loop.c:1969
 process_one_work kernel/workqueue.c:3231 [inline]
 process_scheduled_works+0xae0/0x1c40 kernel/workqueue.c:3312
 worker_thread+0xea5/0x1520 kernel/workqueue.c:3390
 kthread+0x3dd/0x540 kernel/kthread.c:389
 ret_from_fork+0x6d/0x90 arch/x86/kernel/process.c:147
 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244

Uninit was stored to memory at:
 __write_extent_buffer+0x1aa/0x800 fs/btrfs/extent_io.c:3829
 write_extent_buffer fs/btrfs/extent_io.c:3856 [inline]
 copy_extent_buffer_full+0x3ce/0x550 fs/btrfs/extent_io.c:3904
 btrfs_force_cow_block+0x73f/0x2960 fs/btrfs/ctree.c:581
 btrfs_cow_block+0x9a1/0xde0 fs/btrfs/ctree.c:754
 btrfs_search_slot+0x1730/0x4ae0 fs/btrfs/ctree.c:2116
 btrfs_truncate_inode_items+0x5fd/0x4180 fs/btrfs/inode-item.c:515
 truncate_inode_items fs/btrfs/tree-log.c:4186 [inline]
 btrfs_log_inode+0x7096/0x8620 fs/btrfs/tree-log.c:6580
 btrfs_log_inode_parent+0x1236/0x1c30 fs/btrfs/tree-log.c:7106
 btrfs_log_dentry_safe+0x9a/0x100 fs/btrfs/tree-log.c:7207
 btrfs_sync_file+0x15a0/0x2080 fs/btrfs/file.c:1773
 vfs_fsync_range+0x20d/0x270 fs/sync.c:188
 generic_write_sync include/linux/fs.h:2816 [inline]
 btrfs_do_write_iter+0xa17/0xb60 fs/btrfs/file.c:1515
 btrfs_file_write_iter+0x38/0x50 fs/btrfs/file.c:1525
 new_sync_write fs/read_write.c:497 [inline]
 vfs_write+0xb2f/0x1550 fs/read_write.c:590
 ksys_write+0x20f/0x4c0 fs/read_write.c:643
 __do_sys_write fs/read_write.c:655 [inline]
 __se_sys_write fs/read_write.c:652 [inline]
 __x64_sys_write+0x93/0xe0 fs/read_write.c:652
 x64_sys_call+0x306a/0x3ba0 arch/x86/include/generated/asm/syscalls_64.h:2
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0xcd/0x1e0 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

Uninit was created at:
 __alloc_pages_noprof+0x9d6/0xe70 mm/page_alloc.c:4723
 alloc_pages_bulk_noprof+0x19e/0x21e0 mm/page_alloc.c:4648
 btrfs_alloc_page_array fs/btrfs/extent_io.c:704 [inline]
 alloc_eb_folio_array+0x19c/0x750 fs/btrfs/extent_io.c:728
 alloc_extent_buffer+0x75a/0x3ba0 fs/btrfs/extent_io.c:3109
 btrfs_find_create_tree_block+0x46/0x60 fs/btrfs/disk-io.c:614
 btrfs_init_new_buffer fs/btrfs/extent-tree.c:5026 [inline]
 btrfs_alloc_tree_block+0x415/0x1990 fs/btrfs/extent-tree.c:5139
 btrfs_alloc_log_tree_node fs/btrfs/disk-io.c:951 [inline]
 btrfs_add_log_tree+0x1b7/0x7a0 fs/btrfs/disk-io.c:999
 start_log_trans fs/btrfs/tree-log.c:227 [inline]
 btrfs_log_inode_parent+0xa87/0x1c30 fs/btrfs/tree-log.c:7102
 btrfs_log_dentry_safe+0x9a/0x100 fs/btrfs/tree-log.c:7207
 btrfs_sync_file+0x15a0/0x2080 fs/btrfs/file.c:1773
 vfs_fsync_range+0x20d/0x270 fs/sync.c:188
 generic_write_sync include/linux/fs.h:2816 [inline]
 btrfs_do_write_iter+0xa17/0xb60 fs/btrfs/file.c:1515
 btrfs_file_write_iter+0x38/0x50 fs/btrfs/file.c:1525
 new_sync_write fs/read_write.c:497 [inline]
 vfs_write+0xb2f/0x1550 fs/read_write.c:590
 ksys_pwrite64 fs/read_write.c:705 [inline]
 __do_sys_pwrite64 fs/read_write.c:715 [inline]
 __se_sys_pwrite64 fs/read_write.c:712 [inline]
 __x64_sys_pwrite64+0x2c5/0x3b0 fs/read_write.c:712
 x64_sys_call+0xaf4/0x3ba0 arch/x86/include/generated/asm/syscalls_64.h:19
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0xcd/0x1e0 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

CPU: 0 UID: 0 PID: 80 Comm: kswapd0 Not tainted 6.11.0-rc2-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/27/2024
=====================================================

Crashes (2):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/08/05 23:51 upstream de9c2c66ad8e e35c337f .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kmsan-gce-root KMSAN: uninit-value in zswap_store
2024/06/04 21:06 upstream 614da38e2f7a a1feae05 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kmsan-gce-root KMSAN: uninit-value in zswap_store
* Struck through repros no longer work on HEAD.