syzbot


general protection fault in __bch2_fsck_err

Status: upstream: reported C repro on 2024/10/24 13:34
Subsystems: bcachefs
[Documentation on labels]
Reported-by: syzbot+3fb818b3513fe46fdd9f@syzkaller.appspotmail.com
First crash: 188d, last: 58d
Discussions (1)
Title Replies (including bot) Last reply
[syzbot] [bcachefs?] general protection fault in __bch2_fsck_err 0 (1) 2024/10/24 13:34
Last patch testing requests (2)
Created Duration User Patch Repo Result
2025/02/21 13:47 24m retest repro upstream OK log
2024/12/13 13:27 13m retest repro upstream report log

Sample crash report:
bcachefs (loop0): starting version 1.7: mi_btree_bitmap opts=metadata_checksum=none,data_checksum=none,compression=lz4,journal_flush_disabled,fsck,recovery_pass_last=set_may_go_rw,nojournal_transaction_names,reconstruct_alloc,no_data_io
bcachefs (loop0): recovering from clean shutdown, journal seq 10
bcachefs (loop0): Version upgrade required:
Version upgrade from 0.24: unwritten_extents to 1.7: mi_btree_bitmap incomplete
Doing incompatible version upgrade from 0.24: unwritten_extents to 1.20: directory_size
  running recovery passes: check_allocations,check_alloc_info,check_lrus,check_btree_backpointers,check_backpointers_to_extents,check_extents_to_backpointers,check_alloc_to_lru_refs,bucket_gens_init,check_snapshot_trees,check_snapshots,check_subvols,check_subvol_children,delete_dead_snapshots,check_inodes,check_extents,check_indirect_extents,check_dirents,check_xattrs,check_root,check_unreachable_inodes,check_subvolume_structure,check_directory_structure,check_nlinks,set_fs_needs_rebalance
bcachefs (loop0): dropping and reconstructing all alloc info
bcachefs (loop0): accounting_read... done
bcachefs (loop0): alloc_read... done
bcachefs (loop0): stripes_read... done
bcachefs (loop0): snapshots_read... done
bcachefs (loop0): check_allocations... done
bcachefs (loop0): going read-write
bcachefs (loop0): done starting filesystem
FAULT_INJECTION: forcing a failure.
name failslab, interval 1, probability 0, space 0, times 1
CPU: 0 UID: 0 PID: 5323 Comm: syz.0.0 Not tainted 6.14.0-rc4-syzkaller-00073-g5394eea10651 #0
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014
Call Trace:
 <TASK>
 __dump_stack lib/dump_stack.c:94 [inline]
 dump_stack_lvl+0x241/0x360 lib/dump_stack.c:120
 fail_dump lib/fault-inject.c:73 [inline]
 should_fail_ex+0x40a/0x550 lib/fault-inject.c:174
 should_failslab+0xac/0x100 mm/failslab.c:46
 slab_pre_alloc_hook mm/slub.c:4068 [inline]
 slab_alloc_node mm/slub.c:4144 [inline]
 __do_kmalloc_node mm/slub.c:4293 [inline]
 __kmalloc_node_track_caller_noprof+0xdc/0x4c0 mm/slub.c:4313
 __do_krealloc mm/slub.c:4820 [inline]
 krealloc_noprof+0x10f/0x300 mm/slub.c:4873
 bch2_printbuf_make_room+0x1f1/0x350 fs/bcachefs/printbuf.c:59
 bch2_prt_vprintf+0x25b/0x700 fs/bcachefs/printbuf.c:169
 __bch2_fsck_err+0x2b3/0x1420 fs/bcachefs/error.c:293
 bch2_bucket_ref_update+0xac9/0x17c0 fs/bcachefs/buckets.c:466
 __mark_pointer fs/bcachefs/buckets.c:550 [inline]
 bch2_trigger_pointer fs/bcachefs/buckets.c:589 [inline]
 __trigger_extent+0x15a3/0x4db0 fs/bcachefs/buckets.c:736
 bch2_trigger_extent+0x5bb/0xb20 fs/bcachefs/buckets.c:865
 bch2_key_trigger fs/bcachefs/bkey_methods.h:88 [inline]
 bch2_key_trigger_old fs/bcachefs/bkey_methods.h:102 [inline]
 run_one_trans_trigger fs/bcachefs/btree_trans_commit.c:511 [inline]
 run_btree_triggers+0x9b6/0x1510 fs/bcachefs/btree_trans_commit.c:540
 bch2_trans_commit_run_triggers fs/bcachefs/btree_trans_commit.c:573 [inline]
 __bch2_trans_commit+0x262/0x9790 fs/bcachefs/btree_trans_commit.c:1010
 bch2_trans_commit fs/bcachefs/btree_update.h:183 [inline]
 __bch2_resume_logged_op_finsert+0x1a6e/0x36b0 fs/bcachefs/io_misc.c:470
 bch2_fcollapse_finsert+0x286/0x3b0 fs/bcachefs/io_misc.c:535
 bchfs_fcollapse_finsert+0x3a8/0x630 fs/bcachefs/fs-io.c:594
 bch2_fallocate_dispatch+0x3c9/0x540
 vfs_fallocate+0x623/0x7a0 fs/open.c:338
 ksys_fallocate fs/open.c:362 [inline]
 __do_sys_fallocate fs/open.c:367 [inline]
 __se_sys_fallocate fs/open.c:365 [inline]
 __x64_sys_fallocate+0xbc/0x110 fs/open.c:365
 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:0x7f1ad178d169
Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 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:00007f1ad2659038 EFLAGS: 00000246 ORIG_RAX: 000000000000011d
RAX: ffffffffffffffda RBX: 00007f1ad19a5fa0 RCX: 00007f1ad178d169
RDX: 0000000000000000 RSI: 0000000000000020 RDI: 0000000000000004
RBP: 00007f1ad2659090 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000007000000 R11: 0000000000000246 R12: 0000000000000002
R13: 0000000000000000 R14: 00007f1ad19a5fa0 R15: 00007ffe22e2ff48
 </TASK>
Oops: general protection fault, probably for non-canonical address 0xdffffc001fffffff: 0000 [#1] PREEMPT SMP KASAN NOPTI
KASAN: probably user-memory-access in range [0x00000000fffffff8-0x00000000ffffffff]
CPU: 0 UID: 0 PID: 5323 Comm: syz.0.0 Not tainted 6.14.0-rc4-syzkaller-00073-g5394eea10651 #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:__bch2_fsck_err+0x300/0x1420 fs/bcachefs/error.c:297
Code: 4c 8d 6b 0c 4d 89 ee 49 c1 ee 03 43 8a 04 26 84 c0 0f 85 83 0f 00 00 8b 9c 24 2c 01 00 00 ff cb 4c 01 fb 48 89 d8 48 c1 e8 03 <42> 8a 04 20 84 c0 0f 85 82 0f 00 00 0f b6 1b bf 3f 00 00 00 89 de
RSP: 0018:ffffc9000d3c6320 EFLAGS: 00010207
RAX: 000000001fffffff RBX: 00000000ffffffff RCX: ffff88801f254880
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000020
RBP: ffffc9000d3c6500 R08: ffffffff8479d4ed R09: 00000000ffffffff
R10: dffffc0000000000 R11: fffffbfff1d8a7e7 R12: dffffc0000000000
R13: ffffc9000d3c644c R14: 1ffff92001a78c89 R15: 0000000000000000
FS:  00007f1ad26596c0(0000) GS:ffff88801fc00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f1ac58c6000 CR3: 0000000043ee2000 CR4: 0000000000352ef0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
 <TASK>
 bch2_bucket_ref_update+0xac9/0x17c0 fs/bcachefs/buckets.c:466
 __mark_pointer fs/bcachefs/buckets.c:550 [inline]
 bch2_trigger_pointer fs/bcachefs/buckets.c:589 [inline]
 __trigger_extent+0x15a3/0x4db0 fs/bcachefs/buckets.c:736
 bch2_trigger_extent+0x5bb/0xb20 fs/bcachefs/buckets.c:865
 bch2_key_trigger fs/bcachefs/bkey_methods.h:88 [inline]
 bch2_key_trigger_old fs/bcachefs/bkey_methods.h:102 [inline]
 run_one_trans_trigger fs/bcachefs/btree_trans_commit.c:511 [inline]
 run_btree_triggers+0x9b6/0x1510 fs/bcachefs/btree_trans_commit.c:540
 bch2_trans_commit_run_triggers fs/bcachefs/btree_trans_commit.c:573 [inline]
 __bch2_trans_commit+0x262/0x9790 fs/bcachefs/btree_trans_commit.c:1010
 bch2_trans_commit fs/bcachefs/btree_update.h:183 [inline]
 __bch2_resume_logged_op_finsert+0x1a6e/0x36b0 fs/bcachefs/io_misc.c:470
 bch2_fcollapse_finsert+0x286/0x3b0 fs/bcachefs/io_misc.c:535
 bchfs_fcollapse_finsert+0x3a8/0x630 fs/bcachefs/fs-io.c:594
 bch2_fallocate_dispatch+0x3c9/0x540
 vfs_fallocate+0x623/0x7a0 fs/open.c:338
 ksys_fallocate fs/open.c:362 [inline]
 __do_sys_fallocate fs/open.c:367 [inline]
 __se_sys_fallocate fs/open.c:365 [inline]
 __x64_sys_fallocate+0xbc/0x110 fs/open.c:365
 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:0x7f1ad178d169
Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 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:00007f1ad2659038 EFLAGS: 00000246 ORIG_RAX: 000000000000011d
RAX: ffffffffffffffda RBX: 00007f1ad19a5fa0 RCX: 00007f1ad178d169
RDX: 0000000000000000 RSI: 0000000000000020 RDI: 0000000000000004
RBP: 00007f1ad2659090 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000007000000 R11: 0000000000000246 R12: 0000000000000002
R13: 0000000000000000 R14: 00007f1ad19a5fa0 R15: 00007ffe22e2ff48
 </TASK>
Modules linked in:
---[ end trace 0000000000000000 ]---
RIP: 0010:__bch2_fsck_err+0x300/0x1420 fs/bcachefs/error.c:297
Code: 4c 8d 6b 0c 4d 89 ee 49 c1 ee 03 43 8a 04 26 84 c0 0f 85 83 0f 00 00 8b 9c 24 2c 01 00 00 ff cb 4c 01 fb 48 89 d8 48 c1 e8 03 <42> 8a 04 20 84 c0 0f 85 82 0f 00 00 0f b6 1b bf 3f 00 00 00 89 de
RSP: 0018:ffffc9000d3c6320 EFLAGS: 00010207
RAX: 000000001fffffff RBX: 00000000ffffffff RCX: ffff88801f254880
RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000020
RBP: ffffc9000d3c6500 R08: ffffffff8479d4ed R09: 00000000ffffffff
R10: dffffc0000000000 R11: fffffbfff1d8a7e7 R12: dffffc0000000000
R13: ffffc9000d3c644c R14: 1ffff92001a78c89 R15: 0000000000000000
FS:  00007f1ad26596c0(0000) GS:ffff88801fc00000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 0000556be575d340 CR3: 0000000043ee2000 CR4: 0000000000352ef0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
----------------
Code disassembly (best guess):
   0:	4c 8d 6b 0c          	lea    0xc(%rbx),%r13
   4:	4d 89 ee             	mov    %r13,%r14
   7:	49 c1 ee 03          	shr    $0x3,%r14
   b:	43 8a 04 26          	mov    (%r14,%r12,1),%al
   f:	84 c0                	test   %al,%al
  11:	0f 85 83 0f 00 00    	jne    0xf9a
  17:	8b 9c 24 2c 01 00 00 	mov    0x12c(%rsp),%ebx
  1e:	ff cb                	dec    %ebx
  20:	4c 01 fb             	add    %r15,%rbx
  23:	48 89 d8             	mov    %rbx,%rax
  26:	48 c1 e8 03          	shr    $0x3,%rax
* 2a:	42 8a 04 20          	mov    (%rax,%r12,1),%al <-- trapping instruction
  2e:	84 c0                	test   %al,%al
  30:	0f 85 82 0f 00 00    	jne    0xfb8
  36:	0f b6 1b             	movzbl (%rbx),%ebx
  39:	bf 3f 00 00 00       	mov    $0x3f,%edi
  3e:	89 de                	mov    %ebx,%esi

Crashes (15):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/02/27 01:50 upstream 5394eea10651 6a8fcbc4 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root general protection fault in __bch2_fsck_err
2024/12/20 05:55 upstream baaa2567a712 c87fa8a3 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root general protection fault in __bch2_fsck_err
2024/11/29 13:19 upstream 7af08b57bcb9 5df23865 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root general protection fault in __bch2_fsck_err
2024/11/19 21:48 upstream 158f238aa69d 7d02db5a .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root general protection fault in __bch2_fsck_err
2024/11/19 21:47 upstream 158f238aa69d 7d02db5a .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root general protection fault in __bch2_fsck_err
2024/11/15 03:01 upstream cfaaa7d010d1 f6ede3a3 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root general protection fault in __bch2_fsck_err
2024/11/12 01:35 upstream 2d5404caa8c7 75bb1b32 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root general protection fault in __bch2_fsck_err
2024/11/05 23:19 upstream 2e1b3cc9d7f7 da38b4c9 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root general protection fault in __bch2_fsck_err
2024/10/31 18:36 upstream 0fc810ae3ae1 96eb609f .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root general protection fault in __bch2_fsck_err
2024/10/31 09:41 upstream 4236f913808c fb888278 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root general protection fault in __bch2_fsck_err
2024/10/30 01:43 upstream e42b1a9a2557 66aeb999 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root general protection fault in __bch2_fsck_err
2024/10/24 04:51 upstream c2ee9f594da8 15fa2979 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root general protection fault in __bch2_fsck_err
2024/10/20 22:07 upstream db87114dcf13 cd6fc0a3 .config console log report syz / log C [disk image (non-bootable)] [vmlinux] [kernel image] [mounted in repro] ci-snapshot-upstream-root general protection fault in __bch2_fsck_err
2024/10/20 21:45 upstream db87114dcf13 cd6fc0a3 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root general protection fault in __bch2_fsck_err
2024/10/20 13:27 upstream 715ca9dd687f cd6fc0a3 .config console log report [disk image (non-bootable)] [vmlinux] [kernel image] ci-snapshot-upstream-root general protection fault in __bch2_fsck_err
* Struck through repros no longer work on HEAD.