syzbot


general protection fault in bch2_check_allocations

Status: moderation: reported on 2024/06/08 16:45
Subsystems: bcachefs
[Documentation on labels]
Reported-by: syzbot+2044b84f690d1f0f333f@syzkaller.appspotmail.com
First crash: 21d, last: 20d

Sample crash report:
bcachefs (loop1): stripes_read... done
bcachefs (loop1): snapshots_read... done
bcachefs (loop1): check_allocations...
bcachefs (loop1): bch2_dev_usage_init(): error ENOMEM_disk_accounting
Oops: general protection fault, probably for non-canonical address 0xdffffc0000000004: 0000 [#1] PREEMPT SMP KASAN PTI
KASAN: null-ptr-deref in range [0x0000000000000020-0x0000000000000027]
CPU: 0 PID: 6556 Comm: syz-executor.1 Tainted: G        W          6.10.0-rc2-next-20240605-syzkaller #0
Tainted: [W]=WARN
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/02/2024
RIP: 0010:bch2_alloc_write_key fs/bcachefs/btree_gc.c:778 [inline]
RIP: 0010:bch2_gc_alloc_done fs/bcachefs/btree_gc.c:864 [inline]
RIP: 0010:bch2_check_allocations+0x2958/0xb9d0 fs/bcachefs/btree_gc.c:1129
Code: 0f b6 04 38 84 c0 0f 85 77 1d 00 00 48 8b b4 24 9c 07 00 00 48 89 df e8 26 01 01 00 48 89 c3 48 8d 78 01 48 89 f8 48 c1 e8 03 <42> 0f b6 04 38 84 c0 0f 85 6c 1d 00 00 4c 89 b4 24 f8 00 00 00 44
RSP: 0018:ffffc900034de240 EFLAGS: 00010202
RAX: 0000000000000004 RBX: 0000000000000020 RCX: 0000000000040000
RDX: ffffc90009dcc000 RSI: 000000000003ffff RDI: 0000000000000021
RBP: ffffc900034df088 R08: ffffffff840fb171 R09: 1ffffffff25f8704
R10: dffffc0000000000 R11: fffffbfff25f8705 R12: ffffc900034de8ec
R13: ffffc900034de8f8 R14: ffffc900034de9e3 R15: dffffc0000000000
FS:  00007ff5695de6c0(0000) GS:ffff8880b9400000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f7c248e66e4 CR3: 0000000022dac000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 bch2_run_recovery_pass+0xf0/0x1e0 fs/bcachefs/recovery_passes.c:183
 bch2_run_recovery_passes+0x19e/0x820 fs/bcachefs/recovery_passes.c:226
 bch2_fs_recovery+0x238b/0x3730 fs/bcachefs/recovery.c:846
 bch2_fs_start+0x356/0x5b0 fs/bcachefs/super.c:1017
 bch2_fs_open+0xa8d/0xdf0 fs/bcachefs/super.c:2113
 bch2_mount fs/bcachefs/fs.c:1908 [inline]
 bch2_fs_get_tree+0x75e/0x14d0 fs/bcachefs/fs.c:2069
 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+0xf3/0x230 arch/x86/entry/common.c:83
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7ff56887e5ea
Code: d8 64 89 02 48 c7 c0 ff ff ff ff eb a6 e8 de 09 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 b0 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ff5695ddef8 EFLAGS: 00000202 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 00007ff5695ddf80 RCX: 00007ff56887e5ea
RDX: 0000000020000000 RSI: 0000000020000700 RDI: 00007ff5695ddf40
RBP: 0000000020000000 R08: 00007ff5695ddf80 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000202 R12: 0000000020000700
R13: 00007ff5695ddf40 R14: 0000000000005b69 R15: 0000000020000200
 </TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:bch2_alloc_write_key fs/bcachefs/btree_gc.c:778 [inline]
RIP: 0010:bch2_gc_alloc_done fs/bcachefs/btree_gc.c:864 [inline]
RIP: 0010:bch2_check_allocations+0x2958/0xb9d0 fs/bcachefs/btree_gc.c:1129
Code: 0f b6 04 38 84 c0 0f 85 77 1d 00 00 48 8b b4 24 9c 07 00 00 48 89 df e8 26 01 01 00 48 89 c3 48 8d 78 01 48 89 f8 48 c1 e8 03 <42> 0f b6 04 38 84 c0 0f 85 6c 1d 00 00 4c 89 b4 24 f8 00 00 00 44
RSP: 0018:ffffc900034de240 EFLAGS: 00010202
RAX: 0000000000000004 RBX: 0000000000000020 RCX: 0000000000040000
RDX: ffffc90009dcc000 RSI: 000000000003ffff RDI: 0000000000000021
RBP: ffffc900034df088 R08: ffffffff840fb171 R09: 1ffffffff25f8704
R10: dffffc0000000000 R11: fffffbfff25f8705 R12: ffffc900034de8ec
R13: ffffc900034de8f8 R14: ffffc900034de9e3 R15: dffffc0000000000
FS:  00007ff5695de6c0(0000) GS:ffff8880b9400000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f7c248e66e4 CR3: 0000000022dac000 CR4: 00000000003506f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess):
   0:	0f b6 04 38          	movzbl (%rax,%rdi,1),%eax
   4:	84 c0                	test   %al,%al
   6:	0f 85 77 1d 00 00    	jne    0x1d83
   c:	48 8b b4 24 9c 07 00 	mov    0x79c(%rsp),%rsi
  13:	00
  14:	48 89 df             	mov    %rbx,%rdi
  17:	e8 26 01 01 00       	call   0x10142
  1c:	48 89 c3             	mov    %rax,%rbx
  1f:	48 8d 78 01          	lea    0x1(%rax),%rdi
  23:	48 89 f8             	mov    %rdi,%rax
  26:	48 c1 e8 03          	shr    $0x3,%rax
* 2a:	42 0f b6 04 38       	movzbl (%rax,%r15,1),%eax <-- trapping instruction
  2f:	84 c0                	test   %al,%al
  31:	0f 85 6c 1d 00 00    	jne    0x1da3
  37:	4c 89 b4 24 f8 00 00 	mov    %r14,0xf8(%rsp)
  3e:	00
  3f:	44                   	rex.R

Crashes (2):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2024/06/05 07:57 linux-next 234cb065ad82 e1e2c66e .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in bch2_check_allocations
2024/06/04 16:33 linux-next d97496ca23a2 a1feae05 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in bch2_check_allocations
* Struck through repros no longer work on HEAD.