syzbot


kernel BUG in btrfs_qgroup_inherit

Status: upstream: reported C repro on 2025/12/08 07:52
Subsystems: btrfs
[Documentation on labels]
Reported-by: syzbot+b44d4a4885bc82af2a06@syzkaller.appspotmail.com
Fix commit: 428e1b114c1a Revert "btrfs: add ASSERTs on prealloc in qgroup functions"
Patched on: [ci-qemu-gce-upstream-auto ci-qemu-native-arm64-kvm ci-qemu-upstream ci-qemu-upstream-386 ci-qemu2-arm32 ci-qemu2-arm64 ci-qemu2-arm64-compat ci-qemu2-arm64-mte ci-snapshot-upstream-root ci-upstream-bpf-kasan-gce ci-upstream-bpf-next-kasan-gce ci-upstream-gce-arm64 ci-upstream-gce-leak ci-upstream-kasan-badwrites-root ci-upstream-kasan-gce ci-upstream-kasan-gce-386 ci-upstream-kasan-gce-root ci-upstream-kasan-gce-selinux-root ci-upstream-kasan-gce-smack-root ci-upstream-kmsan-gce-386-root ci-upstream-kmsan-gce-root ci-upstream-linux-next-kasan-gce-root ci-upstream-net-kasan-gce ci-upstream-net-this-kasan-gce ci-upstream-rust-kasan-gce ci2-upstream-fs ci2-upstream-kcsan-gce ci2-upstream-usb], missing on: [ci-qemu2-riscv64]
First crash: 43d, last: 37d
Discussions (2)
Title Replies (including bot) Last reply
[PATCH] btrfs: Optimize the timing of prealloc memory allocation 2 (2) 2025/12/08 20:19
[syzbot] [btrfs?] kernel BUG in btrfs_qgroup_inherit 1 (3) 2025/12/08 11:06
Last patch testing requests (1)
Created Duration User Patch Repo Result
2025/12/08 10:50 14m eadavis@qq.com patch upstream report log

Sample crash report:
R13: 00007f24f59e5fa0 R14: 00007f24f59e5fa0 R15: 0000000000000003
 </TASK>
assertion failed: prealloc == NULL :: 0, in fs/btrfs/qgroup.c:3529
------------[ cut here ]------------
kernel BUG at fs/btrfs/qgroup.c:3529!
Oops: invalid opcode: 0000 [#1] SMP KASAN NOPTI
CPU: 0 UID: 0 PID: 5562 Comm: syz.0.19 Not tainted syzkaller #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:btrfs_qgroup_inherit+0x2892/0x28a0 fs/btrfs/qgroup.c:3529
Code: ff ff e8 d1 1f d4 fd 48 c7 c7 a0 e5 b0 8b 48 c7 c6 00 e6 b0 8b 31 d2 48 c7 c1 20 e2 b0 8b 41 b8 c9 0d 00 00 e8 ef 58 3a fd 90 <0f> 0b 66 66 66 2e 0f 1f 84 00 00 00 00 00 90 90 90 90 90 90 90 90
RSP: 0018:ffffc9000cbe7740 EFLAGS: 00010246
RAX: 0000000000000042 RBX: 0000000000000000 RCX: b3bb6c739819f900
RDX: 0000000000000000 RSI: 0000000080000000 RDI: 0000000000000000
RBP: ffffc9000cbe7990 R08: ffffc9000cbe7467 R09: 1ffff9200197ce8c
R10: dffffc0000000000 R11: fffff5200197ce8d R12: 0000000000000000
R13: 0000000000000000 R14: 0000000000000000 R15: 00000000fffffff4
FS:  0000555588ca7500(0000) GS:ffff88808d679000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000001b31b63fff CR3: 0000000011fab000 CR4: 0000000000352ef0
Call Trace:
 <TASK>
 create_subvol+0x5ad/0x18f0 fs/btrfs/ioctl.c:570
 btrfs_mksubvol+0x6e4/0x12c0 fs/btrfs/ioctl.c:928
 __btrfs_ioctl_snap_create+0x2b2/0x730 fs/btrfs/ioctl.c:1201
 btrfs_ioctl_snap_create+0x131/0x180 fs/btrfs/ioctl.c:1259
 btrfs_ioctl+0xb4d/0xd00 fs/btrfs/ioctl.c:-1
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:597 [inline]
 __se_sys_ioctl+0xfc/0x170 fs/ioctl.c:583
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0xfa/0xf80 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f24f578f7c9
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:00007ffc9b4adc18 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007f24f59e5fa0 RCX: 00007f24f578f7c9
RDX: 0000200000000280 RSI: 000000005000940e RDI: 0000000000000003
RBP: 00007ffc9b4adc70 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000002
R13: 00007f24f59e5fa0 R14: 00007f24f59e5fa0 R15: 0000000000000003
 </TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:btrfs_qgroup_inherit+0x2892/0x28a0 fs/btrfs/qgroup.c:3529
Code: ff ff e8 d1 1f d4 fd 48 c7 c7 a0 e5 b0 8b 48 c7 c6 00 e6 b0 8b 31 d2 48 c7 c1 20 e2 b0 8b 41 b8 c9 0d 00 00 e8 ef 58 3a fd 90 <0f> 0b 66 66 66 2e 0f 1f 84 00 00 00 00 00 90 90 90 90 90 90 90 90
RSP: 0018:ffffc9000cbe7740 EFLAGS: 00010246
RAX: 0000000000000042 RBX: 0000000000000000 RCX: b3bb6c739819f900
RDX: 0000000000000000 RSI: 0000000080000000 RDI: 0000000000000000
RBP: ffffc9000cbe7990 R08: ffffc9000cbe7467 R09: 1ffff9200197ce8c
R10: dffffc0000000000 R11: fffff5200197ce8d R12: 0000000000000000
R13: 0000000000000000 R14: 0000000000000000 R15: 00000000fffffff4
FS:  0000555588ca7500(0000) GS:ffff88808d679000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000001b31b63fff CR3: 0000000011fab000 CR4: 0000000000352ef0

Crashes (4):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/12/06 16:08 upstream 416f99c3b16f d1b870e1 .config console log report syz / log C [disk image (non-bootable)] [vmlinux] [kernel image] [mounted in repro (clean fs)] ci-snapshot-upstream-root kernel BUG in btrfs_qgroup_inherit
2025/12/13 00:21 upstream 187d0801404f d1b870e1 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root kernel BUG in btrfs_qgroup_inherit
2025/12/06 19:04 upstream 416f99c3b16f d1b870e1 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root kernel BUG in btrfs_qgroup_inherit
2025/12/06 15:38 upstream 416f99c3b16f d1b870e1 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root kernel BUG in btrfs_qgroup_inherit
* Struck through repros no longer work on HEAD.