syzbot


KMSAN: uninit-value in bch2_readdir (2)

Status: upstream: reported on 2025/01/11 13:37
Subsystems: bcachefs
[Documentation on labels]
Reported-by: syzbot+a7b475122da841580575@syzkaller.appspotmail.com
First crash: 7d19h, last: 3d06h
Discussions (1)
Title Replies (including bot) Last reply
[syzbot] [bcachefs?] KMSAN: uninit-value in bch2_readdir (2) 0 (1) 2025/01/11 13:37
Similar bugs (1)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream KMSAN: uninit-value in bch2_readdir bcachefs 1 217d 214d 0/28 closed as invalid on 2024/08/22 17:25

Sample crash report:
=====================================================
BUG: KMSAN: uninit-value in bch2_dirent_read_target fs/bcachefs/dirent.c:259 [inline]
BUG: KMSAN: uninit-value in bch2_readdir+0x1a45/0x2470 fs/bcachefs/dirent.c:551
 bch2_dirent_read_target fs/bcachefs/dirent.c:259 [inline]
 bch2_readdir+0x1a45/0x2470 fs/bcachefs/dirent.c:551
 bch2_vfs_readdir+0x347/0x7c0 fs/bcachefs/fs.c:1377
 iterate_dir+0x5b3/0x9e0 fs/readdir.c:108
 ovl_dir_read+0x14d/0x840 fs/overlayfs/readdir.c:313
 ovl_check_d_type_supported+0x6a/0x110 fs/overlayfs/readdir.c:1079
 ovl_make_workdir fs/overlayfs/super.c:667 [inline]
 ovl_get_workdir+0x9cb/0x2780 fs/overlayfs/super.c:808
 ovl_fill_super+0x153c/0x62a0 fs/overlayfs/super.c:1376
 vfs_get_super fs/super.c:1280 [inline]
 get_tree_nodev+0x183/0x350 fs/super.c:1299
 ovl_get_tree+0x34/0x40 fs/overlayfs/params.c:676
 vfs_get_tree+0xb1/0x5a0 fs/super.c:1814
 do_new_mount+0x71f/0x15e0 fs/namespace.c:3511
 path_mount+0x742/0x1f10 fs/namespace.c:3838
 do_mount fs/namespace.c:3851 [inline]
 __do_sys_mount fs/namespace.c:4061 [inline]
 __se_sys_mount+0x722/0x810 fs/namespace.c:4038
 __x64_sys_mount+0xe4/0x150 fs/namespace.c:4038
 x64_sys_call+0x39bf/0x3c30 arch/x86/include/generated/asm/syscalls_64.h:166
 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 stored to memory at:
 memcpy_u64s_small fs/bcachefs/util.h:393 [inline]
 bkey_reassemble fs/bcachefs/bkey.h:513 [inline]
 bch2_bkey_buf_reassemble fs/bcachefs/bkey_buf.h:28 [inline]
 bch2_readdir+0xe5f/0x2470 fs/bcachefs/dirent.c:551
 bch2_vfs_readdir+0x347/0x7c0 fs/bcachefs/fs.c:1377
 iterate_dir+0x5b3/0x9e0 fs/readdir.c:108
 ovl_dir_read+0x14d/0x840 fs/overlayfs/readdir.c:313
 ovl_check_d_type_supported+0x6a/0x110 fs/overlayfs/readdir.c:1079
 ovl_make_workdir fs/overlayfs/super.c:667 [inline]
 ovl_get_workdir+0x9cb/0x2780 fs/overlayfs/super.c:808
 ovl_fill_super+0x153c/0x62a0 fs/overlayfs/super.c:1376
 vfs_get_super fs/super.c:1280 [inline]
 get_tree_nodev+0x183/0x350 fs/super.c:1299
 ovl_get_tree+0x34/0x40 fs/overlayfs/params.c:676
 vfs_get_tree+0xb1/0x5a0 fs/super.c:1814
 do_new_mount+0x71f/0x15e0 fs/namespace.c:3511
 path_mount+0x742/0x1f10 fs/namespace.c:3838
 do_mount fs/namespace.c:3851 [inline]
 __do_sys_mount fs/namespace.c:4061 [inline]
 __se_sys_mount+0x722/0x810 fs/namespace.c:4038
 __x64_sys_mount+0xe4/0x150 fs/namespace.c:4038
 x64_sys_call+0x39bf/0x3c30 arch/x86/include/generated/asm/syscalls_64.h:166
 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:
 ___kmalloc_large_node+0x22c/0x370 mm/slub.c:4253
 __kmalloc_large_node_noprof+0x3f/0x1e0 mm/slub.c:4270
 __do_kmalloc_node mm/slub.c:4286 [inline]
 __kmalloc_node_noprof+0xc96/0x1250 mm/slub.c:4304
 __kvmalloc_node_noprof+0xc0/0x2d0 mm/util.c:645
 btree_bounce_alloc fs/bcachefs/btree_io.c:124 [inline]
 btree_node_sort+0x78a/0x1d30 fs/bcachefs/btree_io.c:323
 bch2_btree_post_write_cleanup+0x1b0/0xf20 fs/bcachefs/btree_io.c:2248
 bch2_btree_node_write+0x21c/0x2e0 fs/bcachefs/btree_io.c:2289
 btree_node_write_if_need fs/bcachefs/btree_io.h:151 [inline]
 __btree_node_flush+0x606/0x680 fs/bcachefs/btree_trans_commit.c:252
 bch2_btree_node_flush0+0x35/0x60 fs/bcachefs/btree_trans_commit.c:261
 journal_flush_pins+0xce6/0x1780 fs/bcachefs/journal_reclaim.c:565
 __bch2_journal_reclaim+0xda8/0x1670 fs/bcachefs/journal_reclaim.c:698
 bch2_journal_reclaim_thread+0x18e/0x760 fs/bcachefs/journal_reclaim.c:740
 kthread+0x3e2/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

CPU: 1 UID: 0 PID: 2145 Comm: syz.9.8849 Not tainted 6.13.0-rc6-syzkaller-00231-g77a903cd8e5a #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024
=====================================================

Crashes (2):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/01/12 01:53 upstream 77a903cd8e5a 6dbc6a9b .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kmsan-gce-root KMSAN: uninit-value in bch2_readdir
2025/01/07 13:29 upstream fbfd64d25c7a f3558dbf .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kmsan-gce-root KMSAN: uninit-value in bch2_readdir
* Struck through repros no longer work on HEAD.