syzbot


kernel BUG in prepare_to_merge

Status: fixed on 2023/10/12 12:47
Subsystems: btrfs
[Documentation on labels]
Reported-by: syzbot+ae97a827ae1c3336bbb4@syzkaller.appspotmail.com
Fix commit: 773e722a98e2 btrfs: avoid race between qgroup tree creation and relocation 05d7ce504545 btrfs: exit gracefully if reloc roots don't match 6ebcd021c92b btrfs: reject invalid reloc tree root keys with stack dump
First crash: 242d, last: 199d
Cause bisection: introduced by (bisect log) :
commit 85724171b302914bb8999b9df091fd4616a36eb7
Author: Christoph Hellwig <hch@lst.de>
Date: Tue May 23 08:40:18 2023 +0000

  btrfs: fix the btrfs_get_global_root return value

Crash: WARNING in __btrfs_free_extent (log)
Repro: syz .config
  
Discussions (1)
Title Replies (including bot) Last reply
[syzbot] [btrfs?] kernel BUG in prepare_to_merge 13 (20) 2023/08/02 09:32
Last patch testing requests (5)
Created Duration User Patch Repo Result
2023/08/02 09:12 19m quwenruo.btrfs@gmx.com https://github.com/adam900710/linux graceful_reloc_mismatch OK log
2023/08/02 06:26 14m quwenruo.btrfs@gmx.com https://github.com/adam900710/linux graceful_reloc_mismatch report log
2023/08/02 06:02 14m quwenruo.btrfs@gmx.com https://github.com/adam900710/linux graceful_reloc_mismatch report log
2023/08/02 05:19 14m quwenruo.btrfs@gmx.com https://github.com/adam900710/linux graceful_reloc_mismatch report log
2023/08/01 14:37 19m nogikh@google.com https://github.com/adam900710/linux graceful_reloc_mismatch report log

Sample crash report:
BTRFS info (device loop1): relocating block group 5242880 flags data|metadata
assertion failed: root->reloc_root == reloc_root, in fs/btrfs/relocation.c:1919
------------[ cut here ]------------
kernel BUG at fs/btrfs/relocation.c:1919!
invalid opcode: 0000 [#1] PREEMPT SMP KASAN
CPU: 0 PID: 12638 Comm: syz-executor311 Not tainted 6.5.0-rc3-syzkaller-00297-gd31e3792919e #0
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.2-debian-1.16.2-1 04/01/2014
RIP: 0010:prepare_to_merge+0x9cc/0xcd0 fs/btrfs/relocation.c:1919
Code: c5 e9 81 fd ff ff e8 e3 59 00 fe b9 7f 07 00 00 48 c7 c2 40 d9 b6 8a 48 c7 c6 20 e6 b6 8a 48 c7 c7 a0 da b6 8a e8 54 bc e3 fd <0f> 0b 4c 8b 7c 24 38 48 8b 5c 24 10 44 8b 6c 24 0c e8 ae 59 00 fe
RSP: 0018:ffffc90023e176d0 EFLAGS: 00010282
RAX: 000000000000004f RBX: ffff88801e898560 RCX: 0000000000000000
RDX: 0000000000000000 RSI: ffffffff81698120 RDI: 0000000000000005
RBP: ffff88801e898558 R08: 0000000000000005 R09: 0000000000000000
R10: 0000000080000000 R11: 6f69747265737361 R12: dffffc0000000000
R13: ffff88801e898000 R14: ffff88802d944000 R15: ffff888017616618
FS:  00007fb31aba26c0(0000) GS:ffff88806b600000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fb31ac3a758 CR3: 000000002e1dc000 CR4: 0000000000350ef0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 relocate_block_group+0x8d1/0xe70 fs/btrfs/relocation.c:3749
 btrfs_relocate_block_group+0x714/0xd90 fs/btrfs/relocation.c:4087
 btrfs_relocate_chunk+0x143/0x440 fs/btrfs/volumes.c:3283
 __btrfs_balance fs/btrfs/volumes.c:4018 [inline]
 btrfs_balance+0x20fc/0x3ef0 fs/btrfs/volumes.c:4395
 btrfs_ioctl_balance fs/btrfs/ioctl.c:3604 [inline]
 btrfs_ioctl+0x1362/0x5cf0 fs/btrfs/ioctl.c:4637
 vfs_ioctl fs/ioctl.c:51 [inline]
 __do_sys_ioctl fs/ioctl.c:870 [inline]
 __se_sys_ioctl fs/ioctl.c:856 [inline]
 __x64_sys_ioctl+0x18f/0x210 fs/ioctl.c:856
 do_syscall_x64 arch/x86/entry/common.c:50 [inline]
 do_syscall_64+0x38/0xb0 arch/x86/entry/common.c:80
 entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7fb31abe6e49
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 b1 18 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 b0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fb31aba2168 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007fb31ac73728 RCX: 00007fb31abe6e49
RDX: 00000000200003c0 RSI: 00000000c4009420 RDI: 0000000000000005
RBP: 00007fb31ac73720 R08: 00007fb31aba26c0 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 00007fb31ac7372c
R13: 0000000000000006 R14: 00007ffe768d5660 R15: 00007ffe768d5748
 </TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:prepare_to_merge+0x9cc/0xcd0 fs/btrfs/relocation.c:1919
Code: c5 e9 81 fd ff ff e8 e3 59 00 fe b9 7f 07 00 00 48 c7 c2 40 d9 b6 8a 48 c7 c6 20 e6 b6 8a 48 c7 c7 a0 da b6 8a e8 54 bc e3 fd <0f> 0b 4c 8b 7c 24 38 48 8b 5c 24 10 44 8b 6c 24 0c e8 ae 59 00 fe
RSP: 0018:ffffc90023e176d0 EFLAGS: 00010282
RAX: 000000000000004f RBX: ffff88801e898560 RCX: 0000000000000000
RDX: 0000000000000000 RSI: ffffffff81698120 RDI: 0000000000000005
RBP: ffff88801e898558 R08: 0000000000000005 R09: 0000000000000000
R10: 0000000080000000 R11: 6f69747265737361 R12: dffffc0000000000
R13: ffff88801e898000 R14: ffff88802d944000 R15: ffff888017616618
FS:  00007fb31aba26c0(0000) GS:ffff88806b600000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007fb31ac3a758 CR3: 000000002e1dc000 CR4: 0000000000350ef0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400

Crashes (48):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2023/07/30 17:07 upstream d31e3792919e 2a0d0f29 .config console log report syz C [disk image (non-bootable)] [vmlinux] [kernel image] [mounted in repro] ci-qemu-upstream kernel BUG in prepare_to_merge
2023/07/22 10:26 upstream d192f5382581 27cbe77f .config console log report syz [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-upstream-fs kernel BUG in prepare_to_merge
2023/07/10 04:10 upstream 06c2afb862f9 668cb1fa .config console log report syz [disk image] [vmlinux] [kernel image] [mounted in repro #1] [mounted in repro #2] ci2-upstream-fs kernel BUG in prepare_to_merge
2023/07/03 05:10 upstream 995b406c7e97 bfc47836 .config console log report syz [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-upstream-fs kernel BUG in prepare_to_merge
2023/08/10 05:06 upstream cacc6e22932f 13ca4cd6 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs kernel BUG in prepare_to_merge
2023/08/09 14:58 upstream 13b937206866 8ad1a287 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs kernel BUG in prepare_to_merge
2023/08/08 06:22 upstream a027b2eca0b7 b1b6ae3d .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs kernel BUG in prepare_to_merge
2023/08/05 14:48 upstream 024ff300db33 4ffcc9ef .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root kernel BUG in prepare_to_merge
2023/08/04 03:19 upstream 7bafbd4027ae 74621247 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs kernel BUG in prepare_to_merge
2023/08/04 01:11 upstream 7bafbd4027ae 74621247 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs kernel BUG in prepare_to_merge
2023/08/01 20:10 upstream 5d0c230f1de8 df07ffe8 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs kernel BUG in prepare_to_merge
2023/07/30 15:18 upstream d31e3792919e 2a0d0f29 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream kernel BUG in prepare_to_merge
2023/07/29 12:44 upstream ffabf7c73176 92476829 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs kernel BUG in prepare_to_merge
2023/07/29 03:15 upstream f837f0a3c948 92476829 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs kernel BUG in prepare_to_merge
2023/07/28 21:56 upstream f837f0a3c948 92476829 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs kernel BUG in prepare_to_merge
2023/07/26 18:08 upstream 18b44bc5a672 4d1a770f .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream kernel BUG in prepare_to_merge
2023/07/26 17:54 upstream 18b44bc5a672 41fe1bae .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs kernel BUG in prepare_to_merge
2023/07/25 04:11 upstream 20ea1e7d13c1 b03242d7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs kernel BUG in prepare_to_merge
2023/07/24 02:17 upstream 6eaae1980760 27cbe77f .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs kernel BUG in prepare_to_merge
2023/07/23 06:31 upstream 295e1388de2d 27cbe77f .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs kernel BUG in prepare_to_merge
2023/07/22 08:16 upstream d192f5382581 27cbe77f .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs kernel BUG in prepare_to_merge
2023/07/22 03:54 upstream f7e3a1bafdea abdf9bae .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs kernel BUG in prepare_to_merge
2023/07/18 17:32 upstream fdf0eaf11452 022df2bb .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root kernel BUG in prepare_to_merge
2023/07/17 20:48 upstream fdf0eaf11452 20f8b3c2 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs kernel BUG in prepare_to_merge
2023/07/16 01:22 upstream b6e6cc1f78c7 35d9ecc5 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs kernel BUG in prepare_to_merge
2023/07/15 17:13 upstream b6e6cc1f78c7 35d9ecc5 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream kernel BUG in prepare_to_merge
2023/07/11 14:53 upstream 3f01e9fed845 2f19aa4f .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs kernel BUG in prepare_to_merge
2023/07/11 05:30 upstream 3f01e9fed845 52ae002a .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs kernel BUG in prepare_to_merge
2023/07/11 05:09 upstream 3f01e9fed845 52ae002a .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs kernel BUG in prepare_to_merge
2023/07/09 20:50 upstream 1c7873e33645 668cb1fa .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs kernel BUG in prepare_to_merge
2023/07/08 06:24 upstream 8689f4f2ea56 668cb1fa .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs kernel BUG in prepare_to_merge
2023/07/06 22:42 upstream c17414a273b8 1a2f6297 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs kernel BUG in prepare_to_merge
2023/07/06 09:09 upstream c17414a273b8 ba5dba36 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs kernel BUG in prepare_to_merge
2023/07/04 23:09 upstream 24be4d0b46bb f99c2404 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs kernel BUG in prepare_to_merge
2023/07/02 23:58 upstream 995b406c7e97 bfc47836 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs kernel BUG in prepare_to_merge
2023/07/02 23:05 upstream 995b406c7e97 bfc47836 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs kernel BUG in prepare_to_merge
2023/07/01 21:34 upstream a507db1d8fdc bfc47836 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs kernel BUG in prepare_to_merge
2023/07/01 03:57 upstream 533925cb7604 af3053d2 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs kernel BUG in prepare_to_merge
2023/06/30 03:47 upstream b19edac5992d 01298212 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs kernel BUG in prepare_to_merge
2023/06/29 11:06 upstream b19edac5992d 134ddc02 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs kernel BUG in prepare_to_merge
2023/06/29 01:51 upstream b19edac5992d ca69c785 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs kernel BUG in prepare_to_merge
2023/06/29 01:49 upstream 6f612579be9d 8064cb02 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root kernel BUG in prepare_to_merge
2023/06/28 10:27 upstream b19edac5992d 4cd5bb25 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs kernel BUG in prepare_to_merge
2023/06/28 08:04 upstream b19edac5992d 4cd5bb25 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs kernel BUG in prepare_to_merge
2023/06/28 01:40 upstream b19edac5992d 4cd5bb25 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs kernel BUG in prepare_to_merge
2023/06/27 20:39 upstream b19edac5992d 4cd5bb25 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs kernel BUG in prepare_to_merge
2023/07/21 20:21 upstream f7e3a1bafdea e2c3b400 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 kernel BUG in prepare_to_merge
2023/07/16 02:04 linux-next 7c2878be5732 35d9ecc5 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in prepare_to_merge
* Struck through repros no longer work on HEAD.