syzbot


kernel BUG in bch2_btree_iter_verify_entry_exit

Status: fixed on 2024/06/11 03:41
Subsystems: bcachefs
[Documentation on labels]
Reported-by: syzbot+0dfe05235e38653e2aee@syzkaller.appspotmail.com
Fix commit: 765b8cb8acab bcachefs: Check for subvolues with bogus snapshot/inode fields
First crash: 33d, last: 27d
Cause bisection: introduced by (bisect log) :
commit f7643bc9749f270d487c32dc35b578575bf1adb0
Author: Kent Overstreet <kent.overstreet@linux.dev>
Date: Wed Apr 17 05:26:02 2024 +0000

  bcachefs: make btree read errors silent during scan

Crash: kernel BUG in bch2_btree_iter_peek_slot (log)
Repro: C syz .config
  
Discussions (1)
Title Replies (including bot) Last reply
[syzbot] [bcachefs?] kernel BUG in bch2_btree_iter_verify_entry_exit 0 (1) 2024/05/16 11:52

Sample crash report:
bcachefs (loop0): journal_replay... done
bcachefs (loop0): resume_logged_ops... done
bcachefs (loop0): going read-write
bcachefs (loop0): done starting filesystem
------------[ cut here ]------------
kernel BUG at fs/bcachefs/btree_iter.c:273!
Oops: invalid opcode: 0000 [#1] PREEMPT SMP KASAN PTI
CPU: 0 PID: 5094 Comm: syz-executor180 Not tainted 6.9.0-next-20240515-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/02/2024
RIP: 0010:bch2_btree_iter_verify_entry_exit+0x51b/0x550 fs/bcachefs/btree_iter.c:272
Code: c1 fd ff ff 44 89 e1 80 e1 07 38 c1 0f 8c c6 fd ff ff be 08 00 00 00 4c 89 e7 e8 60 fe e8 fd e9 b4 fd ff ff e8 66 43 83 fd 90 <0f> 0b e8 5e 43 83 fd 90 0f 0b e8 56 43 83 fd 90 0f 0b e8 4e 43 83
RSP: 0018:ffffc9000356f1b8 EFLAGS: 00010293
RAX: ffffffff8413091a RBX: 0000000000000820 RCX: ffff88807cda0000
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
RBP: 0000000000000000 R08: ffffffff84130480 R09: 0000000000000000
R10: ffffc9000356f000 R11: fffff520006ade05 R12: ffffc9000356f680
R13: ffffc9000356f680 R14: 1ffff1100ed4c808 R15: dffffc0000000000
FS:  0000555579c50380(0000) GS:ffff8880b9400000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007ffdceb1cd94 CR3: 000000002d1d2000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 bch2_btree_iter_peek_slot+0x169/0x26d0 fs/bcachefs/btree_iter.c:2584
 __bch2_bkey_get_iter fs/bcachefs/btree_iter.h:552 [inline]
 bch2_bkey_get_iter fs/bcachefs/btree_iter.h:566 [inline]
 bch2_inode_peek_nowarn+0x201/0x4d0 fs/bcachefs/inode.c:340
 bch2_inode_peek fs/bcachefs/inode.c:366 [inline]
 bch2_inode_find_by_inum_trans+0xc4/0x1d0 fs/bcachefs/inode.c:939
 bch2_vfs_inode_get+0x2a2/0x680 fs/bcachefs/fs.c:278
 bch2_mount+0xf32/0x1320 fs/bcachefs/fs.c:1999
 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:0x7ff67fcf1bfa
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:00007fff14da13c8 EFLAGS: 00000282 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 00007fff14da13e0 RCX: 00007ff67fcf1bfa
RDX: 0000000020005b00 RSI: 0000000020000000 RDI: 00007fff14da13e0
RBP: 0000000000000004 R08: 00007fff14da1420 R09: 0000000000005b22
R10: 0000000000000098 R11: 0000000000000282 R12: 0000000000000098
R13: 00007fff14da1420 R14: 0000000000000003 R15: 0000000001000000
 </TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:bch2_btree_iter_verify_entry_exit+0x51b/0x550 fs/bcachefs/btree_iter.c:272
Code: c1 fd ff ff 44 89 e1 80 e1 07 38 c1 0f 8c c6 fd ff ff be 08 00 00 00 4c 89 e7 e8 60 fe e8 fd e9 b4 fd ff ff e8 66 43 83 fd 90 <0f> 0b e8 5e 43 83 fd 90 0f 0b e8 56 43 83 fd 90 0f 0b e8 4e 43 83
RSP: 0018:ffffc9000356f1b8 EFLAGS: 00010293
RAX: ffffffff8413091a RBX: 0000000000000820 RCX: ffff88807cda0000
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000000
RBP: 0000000000000000 R08: ffffffff84130480 R09: 0000000000000000
R10: ffffc9000356f000 R11: fffff520006ade05 R12: ffffc9000356f680
R13: ffffc9000356f680 R14: 1ffff1100ed4c808 R15: dffffc0000000000
FS:  0000555579c50380(0000) GS:ffff8880b9500000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007ffdceb1bff0 CR3: 000000002d1d2000 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
2024/05/15 23:16 linux-next 82d92a9a1b9e 0b3dad46 .config strace log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci-upstream-linux-next-kasan-gce-root kernel BUG in bch2_btree_iter_verify_entry_exit
2024/05/22 05:53 upstream b6394d6f7159 1014eca7 .config console log report info [disk image] [vmlinux] [kernel image] ci2-upstream-fs kernel BUG in bch2_btree_iter_verify_entry_exit
2024/05/15 22:48 linux-next 82d92a9a1b9e 0b3dad46 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root kernel BUG in bch2_btree_iter_verify_entry_exit
* Struck through repros no longer work on HEAD.