Re: [syzbot] [bcachefs?] kernel BUG in bch2_btree_path_peek_slot
From: syzbot
Date: Sat Feb 08 2025 - 18:23:31 EST
syzbot has found a reproducer for the following issue on:
HEAD commit: ed58d103e6da Add linux-next specific files for 20250207
git tree: linux-next
console output: https://syzkaller.appspot.com/x/log.txt?x=11c32b18580000
kernel config: https://syzkaller.appspot.com/x/.config?x=244a34ec1429746
dashboard link: https://syzkaller.appspot.com/bug?extid=3ebaf90b49bd97e920ee
compiler: Debian clang version 15.0.6, GNU ld (GNU Binutils for Debian) 2.40
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=152811b0580000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=13443df8580000
Downloadable assets:
disk image: https://storage.googleapis.com/syzbot-assets/ce459b7174dd/disk-ed58d103.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/60699733c0c8/vmlinux-ed58d103.xz
kernel image: https://storage.googleapis.com/syzbot-assets/f589bce7c898/bzImage-ed58d103.xz
mounted in repro: https://storage.googleapis.com/syzbot-assets/c0e95d2847cc/mount_0.gz
IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+3ebaf90b49bd97e920ee@xxxxxxxxxxxxxxxxxxxxxxxxx
------------[ cut here ]------------
kernel BUG at fs/bcachefs/btree_iter.c:1850!
Oops: invalid opcode: 0000 [#1] PREEMPT SMP KASAN PTI
CPU: 1 UID: 0 PID: 2964 Comm: kworker/u8:8 Not tainted 6.14.0-rc1-next-20250207-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 12/27/2024
Workqueue: btree_update btree_interior_update_work
RIP: 0010:bch2_btree_path_peek_slot+0xfa2/0xfe0 fs/bcachefs/btree_iter.c:1850
Code: f7 ff ff 48 89 34 24 be 08 00 00 00 44 89 44 24 08 e8 f2 e5 e3 fd 48 8b 34 24 44 8b 44 24 08 e9 25 f7 ff ff e8 9f 08 7d fd 90 <0f> 0b e8 97 08 7d fd 90 0f 0b e8 bf 88 b7 07 e8 8a 08 7d fd 90 0f
RSP: 0018:ffffc9000bda5800 EFLAGS: 00010293
RAX: ffffffff84428051 RBX: 0000000000002164 RCX: ffff888030423c00
RDX: 0000000000000000 RSI: 0000000000000100 RDI: 0000000000000000
RBP: ffffc9000bda5910 R08: ffffffff844271e0 R09: 0000000000000000
R10: ffffc9000bda5a80 R11: fffff520017b4b52 R12: dffffc0000000000
R13: 1ffff1100484f0c2 R14: ffff8880242785f0 R15: 1ffff1100484f0c1
FS: 0000000000000000(0000) GS:ffff8880b8700000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f110aa60000 CR3: 0000000077baa000 CR4: 00000000003526f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
<TASK>
bch2_btree_iter_peek_slot+0xb67/0x27c0 fs/bcachefs/btree_iter.c:2799
__bch2_bkey_get_iter fs/bcachefs/btree_iter.h:573 [inline]
bch2_bkey_get_iter fs/bcachefs/btree_iter.h:587 [inline]
bch2_check_discard_freespace_key+0x292/0xeb0 fs/bcachefs/alloc_background.c:1404
try_alloc_bucket fs/bcachefs/alloc_foreground.c:274 [inline]
bch2_bucket_alloc_freelist fs/bcachefs/alloc_foreground.c:425 [inline]
bch2_bucket_alloc_trans+0x1583/0x2ea0 fs/bcachefs/alloc_foreground.c:557
bch2_bucket_alloc_set_trans+0x57c/0xd60 fs/bcachefs/alloc_foreground.c:713
__open_bucket_add_buckets+0x13a2/0x1e10 fs/bcachefs/alloc_foreground.c:956
open_bucket_add_buckets+0x33a/0x410 fs/bcachefs/alloc_foreground.c:1000
bch2_alloc_sectors_start_trans+0xce9/0x2030
__bch2_btree_node_alloc fs/bcachefs/btree_update_interior.c:322 [inline]
bch2_btree_reserve_get+0x612/0x1890 fs/bcachefs/btree_update_interior.c:532
bch2_btree_update_start+0xe56/0x14e0 fs/bcachefs/btree_update_interior.c:1230
bch2_btree_split_leaf+0x121/0x880 fs/bcachefs/btree_update_interior.c:1851
bch2_trans_commit_error+0x212/0x1380 fs/bcachefs/btree_trans_commit.c:908
__bch2_trans_commit+0x804d/0x9680 fs/bcachefs/btree_trans_commit.c:1085
bch2_trans_commit fs/bcachefs/btree_update.h:183 [inline]
btree_update_nodes_written fs/bcachefs/btree_update_interior.c:706 [inline]
btree_interior_update_work+0x1449/0x2a70 fs/bcachefs/btree_update_interior.c:844
process_one_work kernel/workqueue.c:3236 [inline]
process_scheduled_works+0xa66/0x1840 kernel/workqueue.c:3317
worker_thread+0x870/0xd30 kernel/workqueue.c:3398
kthread+0x7a9/0x920 kernel/kthread.c:464
ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:148
ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244
</TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:bch2_btree_path_peek_slot+0xfa2/0xfe0 fs/bcachefs/btree_iter.c:1850
Code: f7 ff ff 48 89 34 24 be 08 00 00 00 44 89 44 24 08 e8 f2 e5 e3 fd 48 8b 34 24 44 8b 44 24 08 e9 25 f7 ff ff e8 9f 08 7d fd 90 <0f> 0b e8 97 08 7d fd 90 0f 0b e8 bf 88 b7 07 e8 8a 08 7d fd 90 0f
RSP: 0018:ffffc9000bda5800 EFLAGS: 00010293
RAX: ffffffff84428051 RBX: 0000000000002164 RCX: ffff888030423c00
RDX: 0000000000000000 RSI: 0000000000000100 RDI: 0000000000000000
RBP: ffffc9000bda5910 R08: ffffffff844271e0 R09: 0000000000000000
R10: ffffc9000bda5a80 R11: fffff520017b4b52 R12: dffffc0000000000
R13: 1ffff1100484f0c2 R14: ffff8880242785f0 R15: 1ffff1100484f0c1
FS: 0000000000000000(0000) GS:ffff8880b8700000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f110a231000 CR3: 000000002f9c4000 CR4: 00000000003526f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
---
If you want syzbot to run the reproducer, reply with:
#syz test: git://repo/address.git branch-or-commit-hash
If you attach or paste a git patch, syzbot will apply it before testing.