syzbot


KMSAN: uninit-value in bch2_extent_crc_append

Status: closed as invalid on 2024/08/22 17:03
Subsystems: bcachefs
[Documentation on labels]
Reported-by: syzbot+c816b9d76d3c2f738309@syzkaller.appspotmail.com
First crash: 195d, last: 195d
Discussions (1)
Title Replies (including bot) Last reply
[syzbot] [bcachefs?] KMSAN: uninit-value in bch2_extent_crc_append 1 (2) 2024/08/22 17:03

Sample crash report:
=====================================================
BUG: KMSAN: uninit-value in variable__ffs arch/x86/include/asm/bitops.h:251 [inline]
BUG: KMSAN: uninit-value in extent_entry_type fs/bcachefs/extents.h:60 [inline]
BUG: KMSAN: uninit-value in extent_entry_bytes fs/bcachefs/extents.h:69 [inline]
BUG: KMSAN: uninit-value in extent_entry_u64s fs/bcachefs/extents.h:82 [inline]
BUG: KMSAN: uninit-value in bch2_extent_crc_append+0x7cd/0x830 fs/bcachefs/extents.c:574
 variable__ffs arch/x86/include/asm/bitops.h:251 [inline]
 extent_entry_type fs/bcachefs/extents.h:60 [inline]
 extent_entry_bytes fs/bcachefs/extents.h:69 [inline]
 extent_entry_u64s fs/bcachefs/extents.h:82 [inline]
 bch2_extent_crc_append+0x7cd/0x830 fs/bcachefs/extents.c:574
 init_append_extent+0x466/0x1050 fs/bcachefs/io_write.c:701
 bch2_write_extent fs/bcachefs/io_write.c:1045 [inline]
 __bch2_write+0x53a5/0x8530 fs/bcachefs/io_write.c:1451
 bch2_write+0xe36/0x1c80 fs/bcachefs/io_write.c:1620
 closure_queue include/linux/closure.h:257 [inline]
 closure_call include/linux/closure.h:390 [inline]
 bch2_dio_write_loop fs/bcachefs/fs-io-direct.c:531 [inline]
 bch2_direct_write+0x290e/0x5340 fs/bcachefs/fs-io-direct.c:652
 bch2_write_iter+0x46d/0x5b30 fs/bcachefs/fs-io-buffered.c:1143
 call_write_iter include/linux/fs.h:2120 [inline]
 new_sync_write fs/read_write.c:497 [inline]
 vfs_write+0xb31/0x14d0 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+0xa4f/0x3b50 arch/x86/include/generated/asm/syscalls_64.h:19
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0xcf/0x1e0 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

Uninit was stored to memory at:
 bch2_extent_crc_pack+0x686/0x6b0 fs/bcachefs/extents.c:530
 bch2_extent_crc_append+0x645/0x830 fs/bcachefs/extents.c:572
 init_append_extent+0x466/0x1050 fs/bcachefs/io_write.c:701
 bch2_write_extent fs/bcachefs/io_write.c:1045 [inline]
 __bch2_write+0x53a5/0x8530 fs/bcachefs/io_write.c:1451
 bch2_write+0xe36/0x1c80 fs/bcachefs/io_write.c:1620
 closure_queue include/linux/closure.h:257 [inline]
 closure_call include/linux/closure.h:390 [inline]
 bch2_dio_write_loop fs/bcachefs/fs-io-direct.c:531 [inline]
 bch2_direct_write+0x290e/0x5340 fs/bcachefs/fs-io-direct.c:652
 bch2_write_iter+0x46d/0x5b30 fs/bcachefs/fs-io-buffered.c:1143
 call_write_iter include/linux/fs.h:2120 [inline]
 new_sync_write fs/read_write.c:497 [inline]
 vfs_write+0xb31/0x14d0 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+0xa4f/0x3b50 arch/x86/include/generated/asm/syscalls_64.h:19
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0xcf/0x1e0 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

Uninit was created at:
 __alloc_pages+0x9d6/0xe70 mm/page_alloc.c:4598
 __alloc_pages_node include/linux/gfp.h:238 [inline]
 alloc_pages_node include/linux/gfp.h:261 [inline]
 alloc_slab_page mm/slub.c:2190 [inline]
 allocate_slab mm/slub.c:2353 [inline]
 new_slab+0x2de/0x1400 mm/slub.c:2406
 ___slab_alloc+0x121d/0x34a0 mm/slub.c:3592
 __slab_alloc mm/slub.c:3682 [inline]
 __slab_alloc_node mm/slub.c:3735 [inline]
 slab_alloc_node mm/slub.c:3908 [inline]
 kmem_cache_alloc+0x6d6/0xc20 mm/slub.c:3925
 mempool_alloc_slab+0x36/0x50 mm/mempool.c:565
 mempool_alloc+0xfa/0x530 mm/mempool.c:408
 bio_alloc_bioset+0xb7c/0x1c10 block/bio.c:554
 bch2_direct_write+0xa50/0x5340 fs/bcachefs/fs-io-direct.c:624
 bch2_write_iter+0x46d/0x5b30 fs/bcachefs/fs-io-buffered.c:1143
 call_write_iter include/linux/fs.h:2120 [inline]
 new_sync_write fs/read_write.c:497 [inline]
 vfs_write+0xb31/0x14d0 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+0xa4f/0x3b50 arch/x86/include/generated/asm/syscalls_64.h:19
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0xcf/0x1e0 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x77/0x7f

CPU: 0 PID: 5884 Comm: syz-executor.4 Tainted: G        W          6.9.0-syzkaller-02707-g614da38e2f7a #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/02/2024
=====================================================

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/05/29 16:08 upstream 614da38e2f7a 34889ee3 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kmsan-gce-root KMSAN: uninit-value in bch2_extent_crc_append
* Struck through repros no longer work on HEAD.