u64s 11 type btree_ptr_v2 SPOS_MAX len 0 ver 0: seq 3b468546fb27822d written 24 min_key POS_MIN durability: 1 ptr: 0:36:0 gen 0 loop0 node offset 8/24 bset u64s 35: checksum error, type chacha20_poly1305_128: got f065da23240067a3cd434ca49ab75de1 should be 230eae69ad0f1e91715326573b3e405a loop0 node offset 16/24 bset u64s 14: checksum error, type chacha20_poly1305_128: got 18612bb0bd5c0ead57b5f85959915bcf should be 6399ef4aeb6d8a4369c39b0b9ed27362 repair success (rewriting node) bcachefs (loop0): check_topology... done bcachefs (loop0): accounting_read... done bcachefs (loop0): alloc_read... done bcachefs (loop0): snapshots_read... done bcachefs (loop0): check_allocations... bcachefs (loop0): bucket 0:34 data type user ptr gen 0 missing in alloc btree while marking u64s 8 type extent 4099:8:U32_MAX len 8 ver 1: durability: 1 crc: c_size 8 size 8 offset 0 nonce 0 csum chacha20_poly1305_80 e371:ac69b75b10c57971 compress incompressible ptr: 0:34:0 gen 0, fixing bcachefs (loop0): bucket 0:27 data type btree ptr gen 0 missing in alloc btree while marking u64s 11 type btree_ptr_v2 SPOS_MAX len 0 ver 0: seq 4e0410879b0c2f04 written 16 min_key POS_MIN durability: 1 ptr: 0:27:0 gen 0, fixing bcachefs (loop0): bucket 0:27 gen 0 different types of data in same bucket: journal, btree while marking u64s 11 type btree_ptr_v2 SPOS_MAX len 0 ver 0: seq 4e0410879b0c2f04 written 16 min_key POS_MIN durability: 1 ptr: 0:27:0 gen 0, fixing bcachefs (loop0): bucket 0:38 data type btree ptr gen 0 missing in alloc btree while marking u64s 11 type btree_ptr_v2 SPOS_MAX len 0 ver 0: seq 2a20405ac3f40602 written 24 min_key POS_MIN durability: 1 ptr: 0:38:0 gen 0, fixing bcachefs (loop0): bucket 0:41 data type btree ptr gen 0 missing in alloc btree while marking u64s 11 type btree_ptr_v2 SPOS_MAX len 0 ver 0: seq 267fcf747c875937 written 24 min_key POS_MIN durability: 1 ptr: 0:41:0 gen 0, fixing bcachefs (loop0): bucket 0:31 data type btree ptr gen 0 missing in alloc btree while marking u64s 11 type btree_ptr_v2 SPOS_MAX len 0 ver 0: seq 1b881868e2a6abe1 written 16 min_key POS_MIN durability: 1 ptr: 0:31:0 gen 0, fixing bcachefs (loop0): bucket 0:35 data type btree ptr gen 0 missing in alloc btree while marking u64s 11 type btree_ptr_v2 SPOS_MAX len 0 ver 0: seq d682cebdf2a7eb26 written 16 min_key POS_MIN durability: 1 ptr: 0:35:0 gen 0, fixing bcachefs (loop0): bucket 0:29 data type btree ptr gen 0 missing in alloc btree while marking u64s 11 type btree_ptr_v2 SPOS_MAX len 0 ver 0: seq b6c44d07df4e9bb7 written 48 min_key POS_MIN durability: 1 ptr: 0:29:0 gen 0, fixing bcachefs (loop0): bucket 0:36 data type btree ptr gen 0 missing in alloc btree while marking u64s 11 type btree_ptr_v2 SPOS_MAX len 0 ver 0: seq 3b468546fb27822d written 24 min_key POS_MIN durability: 1 ptr: 0:36:0 gen 0, fixing bcachefs (loop0): bucket 0:40 data type btree ptr gen 0 missing in alloc btree while marking u64s 11 type btree_ptr_v2 SPOS_MAX len 0 ver 0: seq 82036bda63714c10 written 8 min_key POS_MIN durability: 1 ptr: 0:40:0 gen 0, fixing done bcachefs (loop0): going read-write bcachefs (loop0): journal_replay... bcachefs (loop0): u64s 13 type alloc_v4 0:40:0 len 0 ver 0: gen 0 oldest_gen 0 data_type btree journal_seq_nonempty 0 journal_seq_empty 0 need_discard 0 need_inc_gen 0 dirty_sectors 256 stripe_sectors 0 cached_sectors 0 stripe 0 stripe_redundancy 0 io_time[READ] 0 io_time[WRITE] 0 fragmentation 0 bp_start 8 incorrectly set at freespace:0:40:0 (free 0, genbits 0 should be 0), fixing ================================================================== BUG: KASAN: slab-out-of-bounds in journal_entry_init fs/bcachefs/journal.h:217 [inline] BUG: KASAN: slab-out-of-bounds in bch2_journal_add_entry fs/bcachefs/journal.h:242 [inline] BUG: KASAN: slab-out-of-bounds in bch2_journal_res_put fs/bcachefs/journal.h:320 [inline] BUG: KASAN: slab-out-of-bounds in do_bch2_trans_commit fs/bcachefs/btree_trans_commit.c:868 [inline] BUG: KASAN: slab-out-of-bounds in __bch2_trans_commit+0x359e/0x8880 fs/bcachefs/btree_trans_commit.c:1079 Write of size 8 at addr ffff888055c838d8 by task syz.0.0/5318 CPU: 0 UID: 0 PID: 5318 Comm: syz.0.0 Not tainted 6.16.0-rc3-syzkaller-00121-gf02769e7f272 #0 PREEMPT(full) Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014 Call Trace: dump_stack_lvl+0x189/0x250 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:408 [inline] print_report+0xd2/0x2b0 mm/kasan/report.c:521 kasan_report+0x118/0x150 mm/kasan/report.c:634 journal_entry_init fs/bcachefs/journal.h:217 [inline] bch2_journal_add_entry fs/bcachefs/journal.h:242 [inline] bch2_journal_res_put fs/bcachefs/journal.h:320 [inline] do_bch2_trans_commit fs/bcachefs/btree_trans_commit.c:868 [inline] __bch2_trans_commit+0x359e/0x8880 fs/bcachefs/btree_trans_commit.c:1079 bch2_trans_commit fs/bcachefs/btree_update.h:242 [inline] bch2_journal_replay+0x1789/0x2620 fs/bcachefs/recovery.c:396 bch2_run_recovery_pass fs/bcachefs/recovery_passes.c:485 [inline] __bch2_run_recovery_passes+0x392/0x1010 fs/bcachefs/recovery_passes.c:540 bch2_run_recovery_passes+0x184/0x210 fs/bcachefs/recovery_passes.c:611 bch2_fs_recovery+0x25fd/0x3950 fs/bcachefs/recovery.c:989 bch2_fs_start+0xa99/0xd90 fs/bcachefs/super.c:1203 bch2_fs_get_tree+0xb02/0x14f0 fs/bcachefs/fs.c:2489 vfs_get_tree+0x92/0x2b0 fs/super.c:1804 do_new_mount+0x24a/0xa40 fs/namespace.c:3902 do_mount fs/namespace.c:4239 [inline] __do_sys_mount fs/namespace.c:4450 [inline] __se_sys_mount+0x317/0x410 fs/namespace.c:4427 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:0x7f1212d900ca 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:00007f1213caae68 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5 RAX: ffffffffffffffda RBX: 00007f1213caaef0 RCX: 00007f1212d900ca RDX: 000020000000f640 RSI: 000020000000f680 RDI: 00007f1213caaeb0 RBP: 000020000000f640 R08: 00007f1213caaef0 R09: 0000000000800190 R10: 0000000000800190 R11: 0000000000000246 R12: 000020000000f680 R13: 00007f1213caaeb0 R14: 000000000000f640 R15: 0000200000000380 The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x55c80 head: order:2 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0x4fff00000000040(head|node=1|zone=1|lastcpupid=0x7ff) page_type: f8(unknown) raw: 04fff00000000040 0000000000000000 dead000000000122 0000000000000000 raw: 0000000000000000 0000000000000000 00000001f8000000 0000000000000000 head: 04fff00000000040 0000000000000000 dead000000000122 0000000000000000 head: 0000000000000000 0000000000000000 00000001f8000000 0000000000000000 head: 04fff00000000002 ffffea0001572001 00000000ffffffff 00000000ffffffff head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000004 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 2, migratetype Unmovable, gfp_mask 0xd2800(GFP_NOWAIT|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 10, tgid 10 (kworker/0:1), ts 75392613547, free_ts 0 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x240/0x2a0 mm/page_alloc.c:1704 prep_new_page mm/page_alloc.c:1712 [inline] get_page_from_freelist+0x21e4/0x22c0 mm/page_alloc.c:3669 __alloc_frozen_pages_noprof+0x181/0x370 mm/page_alloc.c:4959 __alloc_pages_noprof+0xa/0x30 mm/page_alloc.c:4993 __alloc_pages_node_noprof include/linux/gfp.h:284 [inline] alloc_pages_node_noprof include/linux/gfp.h:311 [inline] ___kmalloc_large_node+0x85/0x210 mm/slub.c:4272 __kmalloc_large_node_noprof+0x18/0x90 mm/slub.c:4300 __do_kmalloc_node mm/slub.c:4316 [inline] __kmalloc_noprof+0x36f/0x4f0 mm/slub.c:4340 mempool_alloc_noprof+0x1a7/0x510 mm/mempool.c:402 __bch2_trans_get+0xd2/0xd80 fs/bcachefs/btree_iter.c:3377 check_discard_freespace_key_work+0xce/0x450 fs/bcachefs/alloc_background.c:1395 process_one_work kernel/workqueue.c:3238 [inline] process_scheduled_works+0xae1/0x17b0 kernel/workqueue.c:3321 worker_thread+0x8a0/0xda0 kernel/workqueue.c:3402 kthread+0x70e/0x8a0 kernel/kthread.c:464 ret_from_fork+0x3fc/0x770 arch/x86/kernel/process.c:148 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245 page_owner free stack trace missing Memory state around the buggy address: ffff888055c83780: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff888055c83800: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff888055c83880: 00 00 00 00 00 00 00 00 00 00 00 fe fe fe fe fe ^ ffff888055c83900: fe fe fe fe fe fe fe fe fe fe fe fe fe fe fe fe ffff888055c83980: fe fe fe fe fe fe fe fe fe fe fe fe fe fe fe fe ==================================================================