syzbot


kernel BUG in bch2_lru_check_set

Status: upstream: reported on 2024/09/18 19:45
Subsystems: bcachefs
[Documentation on labels]
Reported-by: syzbot+6e8c3cce21d276c02502@syzkaller.appspotmail.com
First crash: 67d, last: 67d
Discussions (1)
Title Replies (including bot) Last reply
[syzbot] [bcachefs?] kernel BUG in bch2_lru_check_set 0 (1) 2024/09/18 19:45

Sample crash report:
  stripe_sectors    0
  cached_sectors    0
  stripe            0
  stripe_redundancy 0
  io_time[READ]     1
  io_time[WRITE]    512
  fragmentation     4222124717768704
  bp_start          8
, fixing
 done
bcachefs (loop0): check_extents_to_backpointers...
missing backpointer for btree=extents l=1 u64s 11 type btree_ptr_v2 SPOS_MAX len 0 ver 0: seq b77ad9ee5a61c7f0 written 16 min_key POS_MIN durability: 1 ptr: 0:27:0 gen 0
  got:   u64s 5 type deleted 0:7077888:0 len 0 ver 0
  want:  u64s 9 type backpointer 0:7077888:0 len 0 ver 0: bucket=0:27:0 btree=extents l=1 offset=0:0 len=256 pos=SPOS_MAX, fixing
missing backpointer for btree=extents l=0 u64s 7 type extent 4098:24:U32_MAX len 24 ver 0: durability: 1 crc: c_size 8 size 24 offset 0 nonce 0 csum crc32c 0:4925b703  compress lz4 ptr: 0:36:0 gen 0
  got:   u64s 5 type deleted 0:9437184:0 len 0 ver 0
  want:  u64s 9 type backpointer 0:9437184:0 len 0 ver 0: bucket=0:36:0 btree=extents l=0 offset=0:0 len=8 pos=4098:24:U32_MAX, fixing
missing backpointer for btree=extents l=0 u64s 7 type extent 536870913:8:U32_MAX len 8 ver 0: durability: 1 crc: c_size 8 size 8 offset 0 nonce 0 csum crc32c 0:cec3872e  compress incompressible ptr: 0:34:0 gen 0
  got:   u64s 5 type deleted 0:8912896:0 len 0 ver 0
  want:  u64s 9 type backpointer 0:8912896:0 len 0 ver 0: bucket=0:34:0 btree=extents l=0 offset=0:0 len=8 pos=536870913:8:U32_MAX, fixing
missing backpointer for btree=inodes l=1 u64s 11 type btree_ptr_v2 SPOS_MAX len 0 ver 0: seq 19bc58a6c09b6540 written 24 min_key POS_MIN durability: 1 ptr: 0:38:0 gen 0
  got:   u64s 5 type deleted 0:9961472:0 len 0 ver 0
  want:  u64s 9 type backpointer 0:9961472:0 len 0 ver 0: bucket=0:38:0 btree=inodes l=1 offset=0:0 len=256 pos=SPOS_MAX, fixing
missing backpointer for btree=dirents l=1 u64s 11 type btree_ptr_v2 SPOS_MAX len 0 ver 0: seq c18f4a4face03c6 written 24 min_key POS_MIN durability: 1 ptr: 0:41:0 gen 0
  got:   u64s 5 type deleted 0:10747904:0 len 0 ver 0
  want:  u64s 9 type backpointer 0:10747904:0 len 0 ver 0: bucket=0:41:0 btree=dirents l=1 offset=0:0 len=256 pos=SPOS_MAX, fixing
missing backpointer for btree=xattrs l=1 u64s 11 type btree_ptr_v2 SPOS_MAX len 0 ver 0: seq 1477538288e6fe55 written 16 min_key POS_MIN durability: 1 ptr: 0:31:0 gen 0
  got:   u64s 5 type deleted 0:8126464:0 len 0 ver 0
  want:  u64s 9 type backpointer 0:8126464:0 len 0 ver 0: bucket=0:31:0 btree=xattrs l=1 offset=0:0 len=256 pos=SPOS_MAX, fixing
missing backpointer for btree=alloc l=1 u64s 11 type btree_ptr_v2 SPOS_MAX len 0 ver 0: seq 75277f57b0c8c24 written 48 min_key POS_MIN durability: 1 ptr: 0:26:0 gen 0
  got:   u64s 5 type deleted 0:6815744:0 len 0 ver 0
  want:  u64s 9 type backpointer 0:6815744:0 len 0 ver 0: bucket=0:26:0 btree=alloc l=1 offset=0:0 len=256 pos=SPOS_MAX, fixing
missing backpointer for btree=subvolumes l=1 u64s 11 type btree_ptr_v2 SPOS_MAX len 0 ver 0: seq 7675f41d391e5d36 written 16 min_key POS_MIN durability: 1 ptr: 0:35:0 gen 0
  got:   u64s 5 type deleted 0:9175040:0 len 0 ver 0
  want:  u64s 9 type backpointer 0:9175040:0 len 0 ver 0: bucket=0:35:0 btree=subvolumes l=1 offset=0:0 len=256 pos=SPOS_MAX, fixing
missing backpointer for btree=snapshots l=1 u64s 11 type btree_ptr_v2 SPOS_MAX len 0 ver 0: seq bcb9905dfb2993d5 written 16 min_key POS_MIN durability: 1 ptr: 0:32:0 gen 0
  got:   u64s 5 type deleted 0:8388608:0 len 0 ver 0
  want:  u64s 9 type backpointer 0:8388608:0 len 0 ver 0: bucket=0:32:0 btree=snapshots l=1 offset=0:0 len=256 pos=SPOS_MAX, fixing
missing backpointer for btree=lru l=1 u64s 11 type btree_ptr_v2 SPOS_MAX len 0 ver 0: seq d19419031ca39bdb written 16 min_key POS_MIN durability: 1 ptr: 0:28:0 gen 0
  got:   u64s 5 type deleted 0:7340032:0 len 0 ver 0
  want:  u64s 9 type backpointer 0:7340032:0 len 0 ver 0: bucket=0:28:0 btree=lru l=1 offset=0:0 len=256 pos=SPOS_MAX, fixing
missing backpointer for btree=freespace l=1 u64s 11 type btree_ptr_v2 SPOS_MAX len 0 ver 0: seq 9a831b4a3f983356 written 56 min_key POS_MIN durability: 1 ptr: 0:29:0 gen 0
  got:   u64s 5 type deleted 0:7602176:0 len 0 ver 0
  want:  u64s 9 type backpointer 0:7602176:0 len 0 ver 0: bucket=0:29:0 btree=freespace l=1 offset=0:0 len=256 pos=SPOS_MAX, fixing
missing backpointer for btree=deleted_inodes l=1 u64s 11 type btree_ptr_v2 SPOS_MAX len 0 ver 0: seq a34c10fbe2d33ffa written 8 min_key POS_MIN durability: 1 ptr: 0:42:0 gen 0
  got:   u64s 5 type deleted 0:11010048:0 len 0 ver 0
  want:  u64s 9 type backpointer 0:11010048:0 len 0 ver 0: bucket=0:42:0 btree=deleted_inodes l=1 offset=0:0 len=256 pos=SPOS_MAX, fixing
 done
bcachefs (loop0): check_alloc_to_lru_refs...
------------[ cut here ]------------
kernel BUG at fs/bcachefs/lru.h:19!
Oops: invalid opcode: 0000 [#1] PREEMPT SMP KASAN NOPTI
CPU: 0 UID: 0 PID: 5117 Comm: syz.0.0 Not tainted 6.11.0-rc7-syzkaller-00135-gb7718454f937 #0
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014
RIP: 0010:lru_pos fs/bcachefs/lru.h:19 [inline]
RIP: 0010:bch2_lru_check_set+0xced/0xd00 fs/bcachefs/lru.c:89
Code: ff 89 d9 80 e1 07 38 c1 0f 8c 50 fb ff ff be 08 00 00 00 48 89 df e8 32 40 c1 fd 48 8b 14 24 e9 3a fb ff ff e8 b4 f6 59 fd 90 <0f> 0b e8 ac f6 59 fd 90 0f 0b e8 64 13 80 07 0f 1f 40 00 90 90 90
RSP: 0018:ffffc90002e7ef00 EFLAGS: 00010246
RAX: ffffffff843995fc RBX: 000f000004000000 RCX: 0000000000040000
RDX: ffffc90003172000 RSI: 000000000003ffff RDI: 0000000000040000
RBP: ffffc90002e7f110 R08: ffffffff84398ae3 R09: 0000000000000000
R10: ffffc90002e7f040 R11: fffff520005cfe0c R12: 0000000000000000
R13: dffffc0000000000 R14: 000000000000ffff R15: ffffc90002e7f42f
FS:  00007f249f1dc6c0(0000) GS:ffff88801fe00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 000055609548a028 CR3: 0000000012610000 CR4: 0000000000350ef0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 bch2_check_alloc_to_lru_ref fs/bcachefs/alloc_background.c:1634 [inline]
 bch2_check_alloc_to_lru_refs+0x792/0x11f0 fs/bcachefs/alloc_background.c:1682
 bch2_run_recovery_pass+0xf0/0x1e0 fs/bcachefs/recovery_passes.c:183
 bch2_run_recovery_passes+0x19e/0x820 fs/bcachefs/recovery_passes.c:230
 bch2_fs_recovery+0x24f9/0x38b0 fs/bcachefs/recovery.c:859
 bch2_fs_start+0x356/0x5b0 fs/bcachefs/super.c:1036
 bch2_fs_get_tree+0xd61/0x1700 fs/bcachefs/fs.c:1954
 vfs_get_tree+0x90/0x2b0 fs/super.c:1800
 do_new_mount+0x2be/0xb40 fs/namespace.c:3472
 do_mount fs/namespace.c:3812 [inline]
 __do_sys_mount fs/namespace.c:4020 [inline]
 __se_sys_mount+0x2d6/0x3c0 fs/namespace.c:3997
 do_syscall_x64 arch/x86/entry/common.c:52 [inline]
 do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f249e37f69a
Code: d8 64 89 02 48 c7 c0 ff ff ff ff eb a6 e8 de 1a 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 a8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007f249f1dbe68 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 00007f249f1dbef0 RCX: 00007f249e37f69a
RDX: 0000000020005d80 RSI: 0000000020000140 RDI: 00007f249f1dbeb0
RBP: 0000000020005d80 R08: 00007f249f1dbef0 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000020000140
R13: 00007f249f1dbeb0 R14: 0000000000005db4 R15: 0000000020000180
 </TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:lru_pos fs/bcachefs/lru.h:19 [inline]
RIP: 0010:bch2_lru_check_set+0xced/0xd00 fs/bcachefs/lru.c:89
Code: ff 89 d9 80 e1 07 38 c1 0f 8c 50 fb ff ff be 08 00 00 00 48 89 df e8 32 40 c1 fd 48 8b 14 24 e9 3a fb ff ff e8 b4 f6 59 fd 90 <0f> 0b e8 ac f6 59 fd 90 0f 0b e8 64 13 80 07 0f 1f 40 00 90 90 90
RSP: 0018:ffffc90002e7ef00 EFLAGS: 00010246
RAX: ffffffff843995fc RBX: 000f000004000000 RCX: 0000000000040000
RDX: ffffc90003172000 RSI: 000000000003ffff RDI: 0000000000040000
RBP: ffffc90002e7f110 R08: ffffffff84398ae3 R09: 0000000000000000
R10: ffffc90002e7f040 R11: fffff520005cfe0c R12: 0000000000000000
R13: dffffc0000000000 R14: 000000000000ffff R15: ffffc90002e7f42f
FS:  00007f249f1dc6c0(0000) GS:ffff88801fe00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00005555641517e0 CR3: 0000000012610000 CR4: 0000000000350ef0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400

Crashes (1):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/09/14 19:39 upstream b7718454f937 08d8a733 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root kernel BUG in bch2_lru_check_set
* Struck through repros no longer work on HEAD.