syzbot


WARNING in tree_insert_offset (2)

Status: upstream: reported on 2025/04/29 20:56
Subsystems: btrfs
[Documentation on labels]
Reported-by: syzbot+3b8bde8dd279360a77f3@syzkaller.appspotmail.com
First crash: 6d17h, last: 5d05h
Discussions (1)
Title Replies (including bot) Last reply
[syzbot] [btrfs?] WARNING in tree_insert_offset (2) 0 (1) 2025/04/29 20:56
Similar bugs (2)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
linux-4.19 WARNING in tree_insert_offset btrfs C error 6 791d 875d 0/1 upstream: reported C repro on 2022/12/08 15:35
upstream WARNING in tree_insert_offset btrfs 3 164d 180d 0/28 auto-obsoleted due to no activity on 2025/02/26 15:27

Sample crash report:
loop0: detected capacity change from 0 to 262144
BTRFS: device fsid b228cae2-8774-489f-9b8f-7356eedc2a2d devid 1 transid 8 /dev/loop0 (7:0) scanned by syz.0.0 (5313)
BTRFS info (device loop0): first mount of filesystem b228cae2-8774-489f-9b8f-7356eedc2a2d
BTRFS info (device loop0): using blake2b (blake2b-256-generic) checksum algorithm
BTRFS info (device loop0): using free-space-tree
BTRFS info (device loop0): scrub: started on devid 1
BTRFS error (device loop0): super block at physical 67108864 devid 1 has bad csum
BTRFS info (device loop0): scrub: finished on devid 1 with status: 0
FAULT_INJECTION: forcing a failure.
name failslab, interval 1, probability 0, space 0, times 1
CPU: 0 UID: 0 PID: 5313 Comm: syz.0.0 Not tainted 6.15.0-rc3-syzkaller-00342-g5bc1018675ec #0 PREEMPT(full) 
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014
Call Trace:
 <TASK>
 dump_stack_lvl+0x189/0x250 lib/dump_stack.c:120
 fail_dump lib/fault-inject.c:73 [inline]
 should_fail_ex+0x414/0x560 lib/fault-inject.c:174
 should_failslab+0xa8/0x100 mm/failslab.c:46
 slab_pre_alloc_hook mm/slub.c:4114 [inline]
 slab_alloc_node mm/slub.c:4190 [inline]
 __kmalloc_cache_noprof+0x70/0x3d0 mm/slub.c:4367
 kmalloc_noprof include/linux/slab.h:905 [inline]
 kzalloc_noprof include/linux/slab.h:1039 [inline]
 btrfs_cache_block_group+0xc1/0x6f0 fs/btrfs/block-group.c:925
 btrfs_update_block_group+0x249/0xad0 fs/btrfs/block-group.c:3704
 do_free_extent_accounting fs/btrfs/extent-tree.c:2977 [inline]
 __btrfs_free_extent+0x16f7/0x2eb0 fs/btrfs/extent-tree.c:3340
 run_delayed_tree_ref fs/btrfs/extent-tree.c:1747 [inline]
 run_one_delayed_ref fs/btrfs/extent-tree.c:1773 [inline]
 btrfs_run_delayed_refs_for_head fs/btrfs/extent-tree.c:1970 [inline]
 __btrfs_run_delayed_refs+0xe7b/0x3a50 fs/btrfs/extent-tree.c:2040
 btrfs_run_delayed_refs+0xe6/0x300 fs/btrfs/extent-tree.c:2152
 btrfs_commit_transaction+0x26f/0x3720 fs/btrfs/transaction.c:2209
 sync_filesystem+0x1cc/0x230 fs/sync.c:66
 btrfs_reconfigure+0x2dd/0x2d30 fs/btrfs/super.c:1504
 reconfigure_super+0x224/0x890 fs/super.c:1083
 do_remount fs/namespace.c:3368 [inline]
 path_mount+0xd18/0xfe0 fs/namespace.c:4203
 do_mount fs/namespace.c:4224 [inline]
 __do_sys_mount fs/namespace.c:4435 [inline]
 __se_sys_mount+0x317/0x410 fs/namespace.c:4412
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0xf6/0x210 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f8ea378e969
Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f8e9fbf5038 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 00007f8ea39b5fa0 RCX: 00007f8ea378e969
RDX: 0000000000000000 RSI: 0000200000000100 RDI: 0000000000000000
RBP: 00007f8e9fbf5090 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000021 R11: 0000000000000246 R12: 0000000000000002
R13: 0000000000000000 R14: 00007f8ea39b5fa0 R15: 00007fff9d31f458
 </TASK>
------------[ cut here ]------------
WARNING: CPU: 0 PID: 5313 at fs/btrfs/free-space-cache.c:1641 tree_insert_offset+0x2bf/0x340 fs/btrfs/free-space-cache.c:1641
Modules linked in:
CPU: 0 UID: 0 PID: 5313 Comm: syz.0.0 Not tainted 6.15.0-rc3-syzkaller-00342-g5bc1018675ec #0 PREEMPT(full) 
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014
RIP: 0010:tree_insert_offset+0x2bf/0x340 fs/btrfs/free-space-cache.c:1641
Code: 48 83 c4 18 5b 41 5c 41 5d 41 5e 41 5f 5d c3 cc cc cc cc cc e8 92 a5 ee fd 90 0f 0b 90 bd ef ff ff ff eb da e8 82 a5 ee fd 90 <0f> 0b 90 bd ef ff ff ff eb ca e8 72 a5 ee fd 90 0f 0b 90 4d 85 e4
RSP: 0018:ffffc9000d38ea68 EFLAGS: 00010293
RAX: ffffffff83d1194e RBX: dffffc0000000000 RCX: ffff88801f090000
RDX: 0000000000000000 RSI: 0000000001504000 RDI: 0000000001504000
RBP: ffff88804203e540 R08: 0000000000000003 R09: 0000000000000004
R10: dffffc0000000000 R11: fffff52001a71d58 R12: ffff88804203e828
R13: ffff88804203e588 R14: 0000000000000000 R15: 0000000001504000
FS:  00007f8e9fbf56c0(0000) GS:ffff88808d6cc000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000055f3591a0338 CR3: 00000000422e9000 CR4: 0000000000352ef0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 link_free_space+0xf5/0x570 fs/btrfs/free-space-cache.c:1847
 btrfs_find_space_for_alloc+0xc4a/0xd50 fs/btrfs/free-space-cache.c:3135
 find_free_extent_unclustered fs/btrfs/extent-tree.c:3760 [inline]
 do_allocation_clustered fs/btrfs/extent-tree.c:3783 [inline]
 do_allocation fs/btrfs/extent-tree.c:3985 [inline]
 find_free_extent+0x2db0/0x56f0 fs/btrfs/extent-tree.c:4520
 btrfs_reserve_extent+0x2fd/0x670 fs/btrfs/extent-tree.c:4674
 btrfs_alloc_tree_block+0x1df/0x1210 fs/btrfs/extent-tree.c:5127
 btrfs_force_cow_block+0x4de/0x1cb0 fs/btrfs/ctree.c:506
 btrfs_cow_block+0x3c2/0x830 fs/btrfs/ctree.c:688
 btrfs_search_slot+0xb4b/0x2a50 fs/btrfs/ctree.c:-1
 btrfs_update_device+0x149/0x4c0 fs/btrfs/volumes.c:3039
 remove_chunk_item+0x169/0x5f0 fs/btrfs/volumes.c:3318
 btrfs_remove_chunk+0x838/0x1910 fs/btrfs/volumes.c:3404
 btrfs_delete_unused_bgs+0xc56/0xf30 fs/btrfs/block-group.c:1701
 btrfs_remount_ro fs/btrfs/super.c:1356 [inline]
 btrfs_reconfigure+0xbcd/0x2d30 fs/btrfs/super.c:1537
 reconfigure_super+0x224/0x890 fs/super.c:1083
 do_remount fs/namespace.c:3368 [inline]
 path_mount+0xd18/0xfe0 fs/namespace.c:4203
 do_mount fs/namespace.c:4224 [inline]
 __do_sys_mount fs/namespace.c:4435 [inline]
 __se_sys_mount+0x317/0x410 fs/namespace.c:4412
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0xf6/0x210 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f8ea378e969
Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f8e9fbf5038 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 00007f8ea39b5fa0 RCX: 00007f8ea378e969
RDX: 0000000000000000 RSI: 0000200000000100 RDI: 0000000000000000
RBP: 00007f8e9fbf5090 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000021 R11: 0000000000000246 R12: 0000000000000002
R13: 0000000000000000 R14: 00007f8ea39b5fa0 R15: 00007fff9d31f458
 </TASK>

Crashes (2):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/04/27 08:30 upstream 5bc1018675ec c6b4fb39 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root WARNING in tree_insert_offset
2025/04/25 20:50 upstream 02ddfb981de8 dea5c7e4 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root WARNING in tree_insert_offset
* Struck through repros no longer work on HEAD.