syzbot


general protection fault in __bch2_err_trace

Status: upstream: reported C repro on 2025/08/05 13:12
Subsystems: bcachefs
[Documentation on labels]
Reported-by: syzbot+8f3825f100f660b04204@syzkaller.appspotmail.com
Fix commit: bcachefs: Delete faulty read_only/nochanges check in fs_open()
Patched on: [ci-upstream-linux-next-kasan-gce-root ci-upstream-rust-kasan-gce], missing on: [ci-qemu-gce-upstream-auto ci-qemu-native-arm64-kvm ci-qemu-upstream ci-qemu-upstream-386 ci-qemu2-arm32 ci-qemu2-arm64 ci-qemu2-arm64-compat ci-qemu2-arm64-mte ci-qemu2-riscv64 ci-snapshot-upstream-root ci-upstream-bpf-kasan-gce ci-upstream-bpf-next-kasan-gce ci-upstream-gce-arm64 ci-upstream-gce-leak ci-upstream-kasan-badwrites-root ci-upstream-kasan-gce ci-upstream-kasan-gce-386 ci-upstream-kasan-gce-root ci-upstream-kasan-gce-selinux-root ci-upstream-kasan-gce-smack-root ci-upstream-kmsan-gce-386-root ci-upstream-kmsan-gce-root ci-upstream-net-kasan-gce ci-upstream-net-this-kasan-gce ci2-upstream-fs ci2-upstream-kcsan-gce ci2-upstream-usb]
First crash: 2d10h, last: 2d04h
Cause bisection: introduced by (bisect log) :
commit f4d93013d06d30718c19708c8477bab9670fd889
Author: Kent Overstreet <kent.overstreet@linux.dev>
Date: Mon Aug 4 01:31:24 2025 +0000

  bcachefs: error_throw counter

Crash: BUG: unable to handle kernel paging request in __bch2_err_trace (log)
Repro: C syz .config
  
Discussions (1)
Title Replies (including bot) Last reply
[syzbot] [bcachefs?] general protection fault in __bch2_err_trace 1 (2) 2025/08/05 14:58

Sample crash report:
loop0: detected capacity change from 0 to 32768
Oops: general protection fault, probably for non-canonical address 0xdffffc00000096c2: 0000 [#1] SMP KASAN PTI
KASAN: probably user-memory-access in range [0x000000000004b610-0x000000000004b617]
CPU: 0 UID: 0 PID: 5865 Comm: syz-executor145 Not tainted 6.16.0-next-20250805-syzkaller #0 PREEMPT(full) 
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 07/12/2025
RIP: 0010:__bch2_err_trace+0x2c/0x230 fs/bcachefs/bcachefs.h:1150
Code: 57 41 56 41 55 41 54 53 89 f3 49 89 fe 49 bd 00 00 00 00 00 fc ff df e8 62 96 65 fd 4d 8d be 10 b6 04 00 4c 89 f8 48 c1 e8 03 <42> 80 3c 28 00 74 08 4c 89 ff e8 a5 00 c9 fd 49 8b 07 65 48 ff 80
RSP: 0018:ffffc9000408f648 EFLAGS: 00010202
RAX: 00000000000096c2 RBX: 00000000fffff716 RCX: ffff88807ed35a00
RDX: 0000000000000000 RSI: 00000000fffff716 RDI: 0000000000000000
RBP: ffffc9000408f970 R08: ffff88807a554000 R09: ffff88807a554000
R10: ffff888148d3f300 R11: ffff88802ffd0380 R12: dffffc0000000000
R13: dffffc0000000000 R14: 0000000000000000 R15: 000000000004b610
FS:  00005555840bd380(0000) GS:ffff888125c24000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007ffb4e035000 CR3: 0000000071f12000 CR4: 00000000003526f0
Call Trace:
 <TASK>
 bch2_fs_open+0x130f/0x27f0 fs/bcachefs/super.c:2546
 bch2_fs_get_tree+0x44f/0x1540 fs/bcachefs/fs.c:2430
 vfs_get_tree+0x92/0x2b0 fs/super.c:1815
 do_new_mount+0x2a2/0x9e0 fs/namespace.c:3805
 do_mount fs/namespace.c:4133 [inline]
 __do_sys_mount fs/namespace.c:4344 [inline]
 __se_sys_mount+0x317/0x410 fs/namespace.c:4321
 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
 do_syscall_64+0xfa/0x3b0 arch/x86/entry/syscall_64.c:94
 entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7fa418864bba
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:00007fff62abeef8 EFLAGS: 00000282 ORIG_RAX: 00000000000000a5
RAX: ffffffffffffffda RBX: 00007fff62abef10 RCX: 00007fa418864bba
RDX: 00002000000058c0 RSI: 0000200000000000 RDI: 00007fff62abef10
RBP: 0000200000000000 R08: 00007fff62abef50 R09: 000000000000591b
R10: 0000000000000000 R11: 0000000000000282 R12: 00002000000058c0
R13: 00007fff62abef50 R14: 0000000000000003 R15: 0000000000000000
 </TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:__bch2_err_trace+0x2c/0x230 fs/bcachefs/bcachefs.h:1150
Code: 57 41 56 41 55 41 54 53 89 f3 49 89 fe 49 bd 00 00 00 00 00 fc ff df e8 62 96 65 fd 4d 8d be 10 b6 04 00 4c 89 f8 48 c1 e8 03 <42> 80 3c 28 00 74 08 4c 89 ff e8 a5 00 c9 fd 49 8b 07 65 48 ff 80
RSP: 0018:ffffc9000408f648 EFLAGS: 00010202
RAX: 00000000000096c2 RBX: 00000000fffff716 RCX: ffff88807ed35a00
RDX: 0000000000000000 RSI: 00000000fffff716 RDI: 0000000000000000
RBP: ffffc9000408f970 R08: ffff88807a554000 R09: ffff88807a554000
R10: ffff888148d3f300 R11: ffff88802ffd0380 R12: dffffc0000000000
R13: dffffc0000000000 R14: 0000000000000000 R15: 000000000004b610
FS:  00005555840bd380(0000) GS:ffff888125d24000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000555d2b962148 CR3: 0000000071f12000 CR4: 00000000003526f0
----------------
Code disassembly (best guess):
   0:	57                   	push   %rdi
   1:	41 56                	push   %r14
   3:	41 55                	push   %r13
   5:	41 54                	push   %r12
   7:	53                   	push   %rbx
   8:	89 f3                	mov    %esi,%ebx
   a:	49 89 fe             	mov    %rdi,%r14
   d:	49 bd 00 00 00 00 00 	movabs $0xdffffc0000000000,%r13
  14:	fc ff df
  17:	e8 62 96 65 fd       	call   0xfd65967e
  1c:	4d 8d be 10 b6 04 00 	lea    0x4b610(%r14),%r15
  23:	4c 89 f8             	mov    %r15,%rax
  26:	48 c1 e8 03          	shr    $0x3,%rax
* 2a:	42 80 3c 28 00       	cmpb   $0x0,(%rax,%r13,1) <-- trapping instruction
  2f:	74 08                	je     0x39
  31:	4c 89 ff             	mov    %r15,%rdi
  34:	e8 a5 00 c9 fd       	call   0xfdc900de
  39:	49 8b 07             	mov    (%r15),%rax
  3c:	65                   	gs
  3d:	48                   	rex.W
  3e:	ff                   	.byte 0xff
  3f:	80                   	.byte 0x80

Crashes (6):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/08/05 10:43 linux-next afec768a6a8f abdcb213 .config strace log report syz / log C [disk image] [vmlinux] [kernel image] [mounted in repro] ci-upstream-linux-next-kasan-gce-root general protection fault in __bch2_err_trace
2025/08/05 10:16 linux-next afec768a6a8f abdcb213 .config strace log report syz / log C [disk image] [vmlinux] [kernel image] [mounted in repro] ci-upstream-linux-next-kasan-gce-root general protection fault in __bch2_err_trace
2025/08/05 07:59 linux-next afec768a6a8f abdcb213 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in __bch2_err_trace
2025/08/05 07:27 linux-next afec768a6a8f abdcb213 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in __bch2_err_trace
2025/08/05 05:04 linux-next afec768a6a8f abdcb213 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in __bch2_err_trace
2025/08/05 05:04 linux-next afec768a6a8f abdcb213 .config console log report info [disk image] [vmlinux] [kernel image] ci-upstream-linux-next-kasan-gce-root general protection fault in __bch2_err_trace
* Struck through repros no longer work on HEAD.