syzbot


KMSAN: uninit-value in __try_merge_extent_node

Status: upstream: reported on 2025/06/18 21:22
Subsystems: f2fs
[Documentation on labels]
Reported-by: syzbot+b8c1d60e95df65e827d4@syzkaller.appspotmail.com
First crash: 23d, last: 6d17h
Discussions (3)
Title Replies (including bot) Last reply
[PATCH v2] f2fs: fix KMSAN uninit-value in extent_info usage 5 (5) 2025/06/25 11:05
[PATCH] f2fs: fix KMSAN uninit-value in extent_info usage 1 (1) 2025/06/19 11:14
[syzbot] [f2fs?] KMSAN: uninit-value in __try_merge_extent_node 0 (1) 2025/06/18 21:22

Sample crash report:
F2FS-fs (loop9): Mounted with checkpoint version = 48b305e4
=====================================================
BUG: KMSAN: uninit-value in __is_extent_mergeable fs/f2fs/extent_cache.c:154 [inline]
BUG: KMSAN: uninit-value in __is_back_mergeable fs/f2fs/extent_cache.c:173 [inline]
BUG: KMSAN: uninit-value in __try_merge_extent_node+0x415/0x1600 fs/f2fs/extent_cache.c:546
 __is_extent_mergeable fs/f2fs/extent_cache.c:154 [inline]
 __is_back_mergeable fs/f2fs/extent_cache.c:173 [inline]
 __try_merge_extent_node+0x415/0x1600 fs/f2fs/extent_cache.c:546
 __update_extent_tree_range+0x1b53/0x2ae0 fs/f2fs/extent_cache.c:776
 __update_extent_cache+0x11cc/0x1420 fs/f2fs/extent_cache.c:950
 f2fs_update_read_extent_cache+0x20/0x30 fs/f2fs/extent_cache.c:1055
 f2fs_update_data_blkaddr+0x428/0x470 fs/f2fs/data.c:1142
 __allocate_data_block fs/f2fs/data.c:1427 [inline]
 f2fs_map_blocks+0x2649/0x5fb0 fs/f2fs/data.c:1621
 f2fs_iomap_begin+0x58b/0xd10 fs/f2fs/data.c:4179
 iomap_iter+0x7ba/0x1270 fs/iomap/iter.c:109
 __iomap_dio_rw+0x14fb/0x3930 fs/iomap/direct-io.c:733
 f2fs_dio_write_iter fs/f2fs/file.c:5092 [inline]
 f2fs_file_write_iter+0x276b/0x4990 fs/f2fs/file.c:5215
 new_sync_write fs/read_write.c:593 [inline]
 vfs_write+0xb4b/0x1580 fs/read_write.c:686
 ksys_write fs/read_write.c:738 [inline]
 __do_sys_write fs/read_write.c:749 [inline]
 __se_sys_write fs/read_write.c:746 [inline]
 __x64_sys_write+0x1fb/0x4d0 fs/read_write.c:746
 x64_sys_call+0x38c3/0x3db0 arch/x86/include/generated/asm/syscalls_64.h:2
 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:
 __attach_extent_node+0x27c/0x630 fs/f2fs/extent_cache.c:302
 f2fs_init_read_extent_tree+0x48b/0xf10 fs/f2fs/extent_cache.c:443
 do_read_inode fs/f2fs/inode.c:541 [inline]
 f2fs_iget+0x7a0e/0x8950 fs/f2fs/inode.c:589
 f2fs_lookup+0x5c3/0x13c0 fs/f2fs/namei.c:499
 lookup_open fs/namei.c:3695 [inline]
 open_last_lookups fs/namei.c:3816 [inline]
 path_openat+0x298a/0x6760 fs/namei.c:4052
 do_filp_open+0x280/0x660 fs/namei.c:4082
 do_sys_openat2+0x1bb/0x2f0 fs/open.c:1437
 do_sys_open fs/open.c:1452 [inline]
 __do_sys_openat fs/open.c:1468 [inline]
 __se_sys_openat fs/open.c:1463 [inline]
 __x64_sys_openat+0x240/0x300 fs/open.c:1463
 x64_sys_call+0x213/0x3db0 arch/x86/include/generated/asm/syscalls_64.h:258
 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 ei created at:
 f2fs_init_read_extent_tree+0xe7/0xf10 fs/f2fs/extent_cache.c:417
 do_read_inode fs/f2fs/inode.c:541 [inline]
 f2fs_iget+0x7a0e/0x8950 fs/f2fs/inode.c:589

CPU: 0 UID: 0 PID: 20366 Comm: syz.9.4279 Not tainted 6.16.0-rc4-syzkaller-00013-g66701750d556 #0 PREEMPT(undef) 
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/07/2025
=====================================================

Crashes (2):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/07/01 23:30 upstream 66701750d556 ffe4b334 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kmsan-gce-root KMSAN: uninit-value in __try_merge_extent_node
2025/06/14 21:11 upstream 4774cfe3543a 5f4b362d .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kmsan-gce-root KMSAN: uninit-value in __try_merge_extent_node
* Struck through repros no longer work on HEAD.