syzbot


kernel panic: bch_dev->ref underflow, last put: bch2_get_next_dev

Status: upstream: reported C repro on 2024/05/14 13:56
Subsystems: bcachefs
[Documentation on labels]
Reported-by: syzbot+a96175a4ea467a49c546@syzkaller.appspotmail.com
First crash: 36d, last: 24d
Cause bisection: introduced by (bisect log) :
commit 552aa5486579c18b4f8e7ca03ef88fa573c517b5
Author: Kent Overstreet <kent.overstreet@linux.dev>
Date: Fri May 3 22:07:40 2024 +0000

  bcachefs: Debug asserts for ca->ref

Crash: kernel panic: bch_dev->ref underflow, last put: bch2_get_next_dev (log)
Repro: C syz .config
  
Discussions (1)
Title Replies (including bot) Last reply
[syzbot] [bcachefs?] kernel panic: bch_dev->ref underflow, last put: bch2_get_next_dev 0 (1) 2024/05/14 13:56
Last patch testing requests (1)
Created Duration User Patch Repo Result
2024/06/07 19:44 22m retest repro linux-next report log

Sample crash report:
bucket 0:19 gen 51 different types of data in same bucket: (invalid data type), sb
while marking sb, shutting down
bcachefs (loop0): inconsistency detected - emergency read only at journal seq 10
bcachefs (loop0): bch2_trans_mark_dev_sb(): error EIO
Kernel panic - not syncing: bch_dev->ref underflow, last put: rcu_lock_acquire include/linux/rcupdate.h:329 [inline]
Kernel panic - not syncing: bch_dev->ref underflow, last put: rcu_read_lock include/linux/rcupdate.h:781 [inline]
Kernel panic - not syncing: bch_dev->ref underflow, last put: bch2_get_next_dev+0x26/0x500 fs/bcachefs/sb-members.h:126
CPU: 1 PID: 5098 Comm: syz-executor215 Not tainted 6.9.0-rc7-next-20240510-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/02/2024
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:88 [inline]
 dump_stack_lvl+0x241/0x360 lib/dump_stack.c:114
 panic+0x349/0x860 kernel/panic.c:347
 __bch2_dev_put fs/bcachefs/sb-members.h:109 [inline]
 bch2_dev_put fs/bcachefs/sb-members.h:121 [inline]
 bch2_trans_mark_dev_sbs_flags+0xaa7/0xab0 fs/bcachefs/buckets.c:1467
 bch2_run_recovery_pass+0xf0/0x1e0 fs/bcachefs/recovery_passes.c:182
 bch2_run_recovery_passes+0x19e/0x820 fs/bcachefs/recovery_passes.c:225
 bch2_fs_recovery+0x2370/0x3700 fs/bcachefs/recovery.c:804
 bch2_fs_start+0x356/0x5b0 fs/bcachefs/super.c:1031
 bch2_fs_open+0xa8d/0xdf0 fs/bcachefs/super.c:2123
 bch2_mount+0x71d/0x1320 fs/bcachefs/fs.c:1917
 legacy_get_tree+0xee/0x190 fs/fs_context.c:662
 vfs_get_tree+0x90/0x2a0 fs/super.c:1780
 do_new_mount+0x2be/0xb40 fs/namespace.c:3352
 do_mount fs/namespace.c:3692 [inline]
 __do_sys_mount fs/namespace.c:3898 [inline]
 __se_sys_mount+0x2d9/0x3c0 fs/namespace.c:3875
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0xf5/0x240 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f7f37cfa8ca
Code: d8 64 89 02 48 c7 c0 ff ff ff ff eb a6 e8 5e 04 00 00 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 49 89 ca b8 a5 00 00 00 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:00007fff662e7d38 EFLAGS: 00000282 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 00007fff662e7d50 RCX: 00007f7f37cfa8ca
RDX: 0000000020011a00 RSI: 0000000020000200 RDI: 00007fff662e7d50
RBP: 0000000000000004 R08: 00007fff662e7d90 R09: 00000000000119eb
R10: 000000000120041c R11: 0000000000000282 R12: 000000000120041c
R13: 00007fff662e7d90 R14: 0000000000000003 R15: 0000000001000000
 </TASK>
Kernel Offset: disabled
Rebooting in 86400 seconds..

Crashes (21):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/05/12 14:56 linux-next 75fa778d74b7 9026e142 .config strace log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci-upstream-linux-next-kasan-gce-root kernel panic: bch_dev->ref underflow, last put: bch2_get_next_dev
2024/05/24 18:02 upstream 8f6a15f095a6 8f98448e .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-smack-root kernel panic: bch_dev->ref underflow, last put: bch2_get_next_dev
2024/05/24 17:04 upstream b6394d6f7159 8f98448e .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs kernel panic: bch_dev->ref underflow, last put: bch2_get_next_dev
2024/05/24 06:50 upstream b6394d6f7159 8f98448e .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs kernel panic: bch_dev->ref underflow, last put: bch2_get_next_dev
2024/05/24 03:17 upstream b6394d6f7159 8f98448e .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs kernel panic: bch_dev->ref underflow, last put: bch2_get_next_dev
2024/05/23 21:16 upstream b6394d6f7159 4c2072ee .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs kernel panic: bch_dev->ref underflow, last put: bch2_get_next_dev
2024/05/23 14:03 upstream b6394d6f7159 4c2072ee .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs kernel panic: bch_dev->ref underflow, last put: bch2_get_next_dev
2024/05/23 10:36 upstream 8f6a15f095a6 4d098039 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-selinux-root kernel panic: bch_dev->ref underflow, last put: bch2_get_next_dev
2024/05/23 09:57 upstream 8f6a15f095a6 4d098039 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-root kernel panic: bch_dev->ref underflow, last put: bch2_get_next_dev
2024/05/23 00:22 upstream b6394d6f7159 4d098039 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs kernel panic: bch_dev->ref underflow, last put: bch2_get_next_dev
2024/05/22 03:38 upstream b6394d6f7159 1014eca7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs kernel panic: bch_dev->ref underflow, last put: bch2_get_next_dev
2024/05/21 12:31 upstream 1b0361620970 c0f1611a .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-kasan-gce-selinux-root kernel panic: bch_dev->ref underflow, last put: bch2_get_next_dev
2024/05/21 09:52 upstream 8f6a15f095a6 4c0d3ee3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs kernel panic: bch_dev->ref underflow, last put: bch2_get_next_dev
2024/05/21 06:15 upstream daa121128a2d c0f1611a .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs kernel panic: bch_dev->ref underflow, last put: bch2_get_next_dev
2024/05/21 04:00 upstream daa121128a2d c0f1611a .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs kernel panic: bch_dev->ref underflow, last put: bch2_get_next_dev
2024/05/20 19:07 upstream eb6a9339efeb c0f1611a .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs kernel panic: bch_dev->ref underflow, last put: bch2_get_next_dev
2024/05/20 17:47 upstream eb6a9339efeb c0f1611a .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs kernel panic: bch_dev->ref underflow, last put: bch2_get_next_dev
2024/05/24 17:18 upstream 6d69b6c12fce c2e07261 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 kernel panic: bch_dev->ref underflow, last put: bch2_get_next_dev
2024/05/22 07:47 upstream 2a8120d7b482 c2e07261 .config console log report info [disk image (non-bootable)] [vmlinux] [kernel image] ci-qemu-upstream-386 kernel panic: bch_dev->ref underflow, last put: bch2_get_next_dev
2024/05/14 22:12 linux-next 26dd54d03cd9 fdb4c10c .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel panic: bch_dev->ref underflow, last put: bch2_get_next_dev
2024/05/12 14:34 linux-next 75fa778d74b7 9026e142 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel panic: bch_dev->ref underflow, last put: bch2_get_next_dev
* Struck through repros no longer work on HEAD.