syzbot


kernel BUG in btrfs_free_tree_block

Status: upstream: reported C repro on 2023/08/12 21:44
Bug presence: origin:upstream
Labels: missing-backport
[Documentation on labels]
Reported-by: syzbot+f53e1aed131332f2003c@syzkaller.appspotmail.com
First crash: 420d, last: 208d
Fix bisection: the issue occurs on the latest tested release (bisect log)
Crash: WARNING in btrfs_space_info_update_bytes_may_use (log)
Repro: C syz .config
  
Bug presence (3)
Date Name Commit Repro Result
2024/02/09 linux-6.1.y (ToT) f1bb70486c9c C [report] WARNING in btrfs_space_info_update_bytes_may_use
2023/08/12 upstream (ToT) a785fd28d31f C [report] WARNING in btrfs_space_info_update_bytes_may_use
2024/02/09 upstream (ToT) 1f719a2f3fa6 C Didn't crash
Similar bugs (2)
Kernel Title Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream kernel BUG in btrfs_free_tree_block btrfs C error 150 54d 741d 27/28 fixed on 2024/08/14 03:44
linux-5.15 kernel BUG in btrfs_free_tree_block origin:upstream C error 2 2d06h 461d 0/3 upstream: reported C repro on 2023/07/03 03:56
Fix bisection attempts (6)
Created Duration User Patch Repo Result
2024/03/22 14:43 1h51m fix candidate upstream OK (0) job log
2024/03/12 01:51 1h07m bisect fix linux-6.1.y OK (0) job log log
2024/02/05 12:11 1h39m bisect fix linux-6.1.y OK (0) job log log
2023/12/31 22:12 1h39m bisect fix linux-6.1.y OK (0) job log log
2023/11/09 13:12 1h09m bisect fix linux-6.1.y OK (0) job log log
2023/10/06 03:14 1h06m bisect fix linux-6.1.y OK (0) job log log

Sample crash report:
RDX: 00000000200003c0 RSI: 00000000c4009420 RDI: 0000000000000004
RBP: 0000000000000002 R08: 00007fffdaebcbb6 R09: 0000000000003233
R10: 0000000000000002 R11: 0000000000000246 R12: 00007fffdaebce70
R13: 00007fffdaebd0f8 R14: 431bde82d7b634db R15: 00007faafd2a701d
 </TASK>
------------[ cut here ]------------
kernel BUG at fs/btrfs/extent-tree.c:3277!
invalid opcode: 0000 [#1] PREEMPT SMP KASAN
CPU: 0 PID: 3549 Comm: syz-executor256 Not tainted 6.1.45-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/26/2023
RIP: 0010:btrfs_free_tree_block+0xd1b/0xd20 fs/btrfs/extent-tree.c:3277
Code: 44 89 f1 80 e1 07 38 c1 0f 8c 90 f8 ff ff be 08 00 00 00 4c 89 f7 e8 a4 87 60 fe e9 7e f8 ff ff e8 8a cb 04 07 e8 35 f4 09 fe <0f> 0b 0f 1f 00 55 41 57 41 56 41 55 41 54 53 48 83 ec 38 49 89 f7
RSP: 0018:ffffc90003bdf4c0 EFLAGS: 00010293
RAX: ffffffff838009cb RBX: 00000000fffffff4 RCX: ffff88807d2d0000
RDX: 0000000000000000 RSI: 00000000fffffff4 RDI: 0000000000000000
RBP: ffffc90003bdf610 R08: ffffffff83800025 R09: fffffbfff1a4365b
R10: 0000000000000000 R11: dffffc0000000001 R12: ffff8880241e4120
R13: dffffc0000000000 R14: 0000000000000001 R15: ffffc90003bdf540
FS:  00005555557fe480(0000) GS:ffff8880b9800000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000020001000 CR3: 0000000076d3a000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 __btrfs_cow_block+0xe79/0x1970 fs/btrfs/ctree.c:488
 btrfs_cow_block+0x3df/0x7d0 fs/btrfs/ctree.c:593
 btrfs_search_slot+0xbe5/0x2f00 fs/btrfs/ctree.c:2041
 btrfs_insert_empty_items+0x98/0x180 fs/btrfs/ctree.c:4139
 btrfs_insert_empty_item fs/btrfs/ctree.h:3130 [inline]
 insert_balance_item+0x2c8/0x20b0 fs/btrfs/volumes.c:3488
 btrfs_balance+0x98a/0x10c0 fs/btrfs/volumes.c:4387
 btrfs_ioctl_balance+0x493/0x7c0 fs/btrfs/ioctl.c:4488
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:870 [inline]
 __se_sys_ioctl+0xf1/0x160 fs/ioctl.c:856
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7faafd25e699
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 f1 17 00 00 90 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 b8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fffdaebce18 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007fffdaebce20 RCX: 00007faafd25e699
RDX: 00000000200003c0 RSI: 00000000c4009420 RDI: 0000000000000004
RBP: 0000000000000002 R08: 00007fffdaebcbb6 R09: 0000000000003233
R10: 0000000000000002 R11: 0000000000000246 R12: 00007fffdaebce70
R13: 00007fffdaebd0f8 R14: 431bde82d7b634db R15: 00007faafd2a701d
 </TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:btrfs_free_tree_block+0xd1b/0xd20 fs/btrfs/extent-tree.c:3277
Code: 44 89 f1 80 e1 07 38 c1 0f 8c 90 f8 ff ff be 08 00 00 00 4c 89 f7 e8 a4 87 60 fe e9 7e f8 ff ff e8 8a cb 04 07 e8 35 f4 09 fe <0f> 0b 0f 1f 00 55 41 57 41 56 41 55 41 54 53 48 83 ec 38 49 89 f7
RSP: 0018:ffffc90003bdf4c0 EFLAGS: 00010293
RAX: ffffffff838009cb RBX: 00000000fffffff4 RCX: ffff88807d2d0000
RDX: 0000000000000000 RSI: 00000000fffffff4 RDI: 0000000000000000
RBP: ffffc90003bdf610 R08: ffffffff83800025 R09: fffffbfff1a4365b
R10: 0000000000000000 R11: dffffc0000000001 R12: ffff8880241e4120
R13: dffffc0000000000 R14: 0000000000000001 R15: ffffc90003bdf540
FS:  00005555557fe480(0000) GS:ffff8880b9800000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000000020001000 CR3: 0000000076d3a000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400

Crashes (3):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/08/12 21:43 linux-6.1.y 1321ab403b38 39990d51 .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-6-1-kasan kernel BUG in btrfs_free_tree_block
2023/12/01 19:14 linux-6.1.y 6ac30d748bb0 f819d6f7 .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-6-1-kasan-arm64 kernel BUG in btrfs_free_tree_block
2023/12/01 18:41 linux-6.1.y 6ac30d748bb0 f819d6f7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-6-1-kasan-arm64 kernel BUG in btrfs_free_tree_block
* Struck through repros no longer work on HEAD.