kernel BUG in btrfs_backref_release_cache (4)

Status: upstream: reported on 2026/10/01 21:38
Subsystems: btrfs
Labels: prio:high
[Documentation on labels]
Reported-by: syzbot+918038c3f9425b05dcd3@syzkaller.appspotmail.com
First crash: 65d, last: 12h23m
✨ AI cause bisection: introduced by (AI job) :
commit 75bfb9aff45e44625260f52a5fd581b92ace3e62
Author: Josef Bacik <jbacik@fb.com>
Date: Fri Sep 19 14:40:00 2014 +0000

  Btrfs: cleanup error handling in build_backref_tree

▶ ▼ ✨ AI Jobs (3)
ID Workflow Result Correct Bug Created Started Finished Revision
1b6d6f8e bisect-cause IsRelease: ❌ ❓ kernel BUG in btrfs_backref_release_cache (4) 2026/11/30 16:57 2026/11/30 16:58 2026/11/30 17:51 ba8e13b2
eccee60b repro-c 💥 kernel BUG in btrfs_backref_release_cache (4) 2026/09/30 05:13 2026/09/30 05:13 2026/09/30 10:30 7808aef4
34d29557 assessment-security DenialOfService: ✅ Exploitable: ✅ FilesystemTrigger: ✅ NetworkTrigger: ❌ PeripheralTrigger: ✅ RemoteTrigger: ❌ Unprivileged: ❌ UserNamespace: ❌ VMGuestTrigger: ❌ VMHostTrigger: ❌ ❓ kernel BUG in btrfs_backref_release_cache (4) 2026/09/29 00:01 2026/09/29 00:01 2026/09/29 00:44 58f15308
▶ ▼ Discussions (1)
Title Replies (including bot) Last reply
[syzbot] [btrfs?] kernel BUG in btrfs_backref_release_cache (4) 0 (1) 2026/10/01 21:38
▶ ▼ Similar bugs (3)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
upstream kernel BUG in btrfs_backref_release_cache (3) prio:high btrfs -1 3 169d 268d 0/30 auto-obsoleted due to no activity on 2026/09/24 13:51
upstream kernel BUG in btrfs_backref_release_cache btrfs -1 3 606d 649d 0/30 auto-obsoleted due to no activity on 2025/07/14 03:57
upstream kernel BUG in btrfs_backref_release_cache (2) btrfs -1 3 373d 407d 0/30 auto-obsoleted due to no activity on 2026/03/04 03:31

Sample crash report:
loop0: detected capacity change from 0 to 32768
BTRFS: device fsid 395ef67a-297e-477c-816d-cd80a5b93e5d devid 1 transid 8 /dev/loop0 (7:0) scanned by syz.0.0 (5354)
BTRFS info (device loop0): first mount of filesystem 395ef67a-297e-477c-816d-cd80a5b93e5d
BTRFS info (device loop0): using sha256 checksum algorithm
BTRFS info (device loop0): rebuilding free space tree
BTRFS info (device loop0): enabling ssd optimizations
BTRFS info (device loop0): using spread ssd allocation scheme
BTRFS info (device loop0): turning on async discard
BTRFS info (device loop0): enabling free space tree
BTRFS info (device loop0): force clearing of disk cache
BTRFS info (device loop0): balance: start -dconvert=raid0 -mconvert=raid0
BTRFS info (device loop0): relocating block group 6881280 flags data|metadata
BTRFS info (device loop0): relocating block group 5242880 flags data|metadata
assertion failed: !cache->nr_nodes, in fs/btrfs/backref.c:3163 (cache->nr_nodes=2)
------------[ cut here ]------------
kernel BUG at fs/btrfs/backref.c:3163!
Oops: invalid opcode: 0000 [#1] SMP KASAN NOPTI
CPU: 0 UID: 0 PID: 5354 Comm: syz.0.0 Not tainted syzkaller #0 PREEMPT(full) 
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2 04/01/2014
RIP: 0010:btrfs_backref_release_cache+0x1fe/0x230 fs/btrfs/backref.c:3163
Code: 0f 0b e8 d5 8e 81 fd 48 c7 c7 40 99 7c 8c 48 c7 c6 a0 99 7c 8c 48 c7 c2 a0 90 7c 8c b9 5b 0c 00 00 41 89 e8 e8 63 f0 df fc 90 <0f> 0b e8 ab 8e 81 fd 48 c7 c7 e0 99 7c 8c 48 c7 c6 40 9a 7c 8c 48
RSP: 0018:ffffc9000e2e77e8 EFLAGS: 00010246
RAX: 0000000000000052 RBX: ffff88801f9c2020 RCX: f3d7074428aa0f00
RDX: ffffc9000ef6a000 RSI: 000000000002148f RDI: 0000000000021490
RBP: 0000000000000002 R08: ffffc9000e2e7567 R09: 1ffff92001c5ceac
R10: dffffc0000000000 R11: fffff52001c5cead R12: dffffc0000000000
R13: 1ffff11003f38404 R14: ffff88801f9c20f0 R15: ffff8880547713a8
FS:  00007f7cd2f936c0(0000) GS:ffff88808a9e5000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000560abf2cdb80 CR3: 00000000411c8000 CR4: 0000000000352ef0
Call Trace:
 <TASK>
 relocate_block_group+0xb6a/0xea0 fs/btrfs/relocation.c:3753
 do_nonremap_reloc+0xa7/0x560 fs/btrfs/relocation.c:5388
 btrfs_relocate_block_group+0x6dd/0xaf0 fs/btrfs/relocation.c:5555
 btrfs_relocate_chunk+0x114/0x810 fs/btrfs/volumes.c:3768
 __btrfs_balance+0x1b5f/0x29d0 fs/btrfs/volumes.c:4707
 btrfs_balance+0xaa6/0x1180 fs/btrfs/volumes.c:5094
 btrfs_ioctl_balance+0x3da/0x640 fs/btrfs/ioctl.c:3518
 vfs_ioctl fs/ioctl.c:52 [inline]
 __do_sys_ioctl fs/ioctl.c:598 [inline]
 __se_sys_ioctl+0xfc/0x170 fs/ioctl.c:584
 do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline]
 do_syscall_64+0x171/0x540 arch/x86/entry/syscall_64.c:89
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f7cd21a9c99
Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 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 e8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f7cd2f92fe8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007f7cd2435fa0 RCX: 00007f7cd21a9c99
RDX: 00002000000077c0 RSI: 00000000c4009420 RDI: 0000000000000004
RBP: 00007f7cd223b18b R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f7cd2436038 R14: 00007f7cd2435fa0 R15: 00007fffdb71dc68
 </TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:btrfs_backref_release_cache+0x1fe/0x230 fs/btrfs/backref.c:3163
Code: 0f 0b e8 d5 8e 81 fd 48 c7 c7 40 99 7c 8c 48 c7 c6 a0 99 7c 8c 48 c7 c2 a0 90 7c 8c b9 5b 0c 00 00 41 89 e8 e8 63 f0 df fc 90 <0f> 0b e8 ab 8e 81 fd 48 c7 c7 e0 99 7c 8c 48 c7 c6 40 9a 7c 8c 48
RSP: 0018:ffffc9000e2e77e8 EFLAGS: 00010246
RAX: 0000000000000052 RBX: ffff88801f9c2020 RCX: f3d7074428aa0f00
RDX: ffffc9000ef6a000 RSI: 000000000002148f RDI: 0000000000021490
RBP: 0000000000000002 R08: ffffc9000e2e7567 R09: 1ffff92001c5ceac
R10: dffffc0000000000 R11: fffff52001c5cead R12: dffffc0000000000
R13: 1ffff11003f38404 R14: ffff88801f9c20f0 R15: ffff8880547713a8
FS:  00007f7cd2f936c0(0000) GS:ffff88808a9e5000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000560abf2cdb80 CR3: 00000000411c8000 CR4: 0000000000352ef0

Crashes (5):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2026/12/02 07:16 upstream 693c2e04e3f1 35891725 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root kernel BUG in btrfs_backref_release_cache
2026/11/29 23:22 upstream 4f069ab1ec24 e1f06033 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root kernel BUG in btrfs_backref_release_cache
2026/11/29 09:23 upstream 3dbdc13bd4b3 e1f06033 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root kernel BUG in btrfs_backref_release_cache
2026/11/25 14:30 upstream 4dce97c6c265 3c378476 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root kernel BUG in btrfs_backref_release_cache
2026/09/27 21:33 upstream d266640c6c76 a3c7249d .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root kernel BUG in btrfs_backref_release_cache
* Struck through repros no longer work on HEAD.