loop0: detected capacity change from 0 to 32768 bcachefs (loop0): starting version 1.7: mi_btree_bitmap opts=metadata_checksum=none,data_checksum=none,compression=lz4,nojournal_transaction_names allowing incompatible features above 0.0: (unknown version) features: lz4,new_siphash,inline_data,new_extent_overwrite,btree_ptr_v2,new_varint,journal_no_flush,alloc_v2,extents_across_btree_nodes bcachefs (loop0): Using encoding defined by superblock: utf8-12.1.0 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.28: inode_has_case_insensitive 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,check_rebalance_work,set_fs_needs_rebalance ================================================================== BUG: KASAN: slab-out-of-bounds in bch2_btree_node_read_done+0x950/0x5550 fs/bcachefs/btree_io.c:1128 Read of size 8 at addr ffff8880443aa010 by task syz.0.0/5360 CPU: 0 UID: 0 PID: 5360 Comm: syz.0.0 Not tainted syzkaller #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:378 [inline] print_report+0xca/0x240 mm/kasan/report.c:482 kasan_report+0x118/0x150 mm/kasan/report.c:595 bch2_btree_node_read_done+0x950/0x5550 fs/bcachefs/btree_io.c:1128 btree_node_read_work+0x40e/0xe60 fs/bcachefs/btree_io.c:1440 bch2_btree_node_read+0x887/0x2a00 fs/bcachefs/btree_io.c:-1 __bch2_btree_root_read fs/bcachefs/btree_io.c:1906 [inline] bch2_btree_root_read+0x5f0/0x760 fs/bcachefs/btree_io.c:1928 read_btree_roots+0x2c6/0x840 fs/bcachefs/recovery.c:615 bch2_fs_recovery+0x261f/0x3a50 fs/bcachefs/recovery.c:1006 bch2_fs_start+0xaaf/0xda0 fs/bcachefs/super.c:1213 bch2_fs_get_tree+0xb39/0x1520 fs/bcachefs/fs.c:2488 vfs_get_tree+0x92/0x2b0 fs/super.c:1815 do_new_mount+0x2a2/0x9e0 fs/namespace.c:3808 do_mount fs/namespace.c:4136 [inline] __do_sys_mount fs/namespace.c:4347 [inline] __se_sys_mount+0x317/0x410 fs/namespace.c:4324 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:0x7f9e3a39066a 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:00007f9e367f4e68 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5 RAX: ffffffffffffffda RBX: 00007f9e367f4ef0 RCX: 00007f9e3a39066a RDX: 00002000000058c0 RSI: 0000200000000000 RDI: 00007f9e367f4eb0 RBP: 00002000000058c0 R08: 00007f9e367f4ef0 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000200000000000 R13: 00007f9e367f4eb0 R14: 00000000000058f2 R15: 0000200000000180 Allocated by task 5360: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3e/0x80 mm/kasan/common.c:68 poison_kmalloc_redzone mm/kasan/common.c:388 [inline] __kasan_kmalloc+0x93/0xb0 mm/kasan/common.c:405 kasan_kmalloc include/linux/kasan.h:260 [inline] __do_kmalloc_node mm/slub.c:4376 [inline] __kvmalloc_node_noprof+0x30d/0x5f0 mm/slub.c:5067 btree_node_data_alloc+0xdc/0x270 fs/bcachefs/btree_cache.c:151 __bch2_btree_node_mem_alloc+0x1dc/0x2e0 fs/bcachefs/btree_cache.c:193 bch2_fs_btree_cache_init+0x314/0x870 fs/bcachefs/btree_cache.c:653 bch2_fs_alloc fs/bcachefs/super.c:998 [inline] bch2_fs_open+0x1ceb/0x2600 fs/bcachefs/super.c:2433 bch2_fs_get_tree+0x44f/0x1520 fs/bcachefs/fs.c:2472 vfs_get_tree+0x92/0x2b0 fs/super.c:1815 do_new_mount+0x2a2/0x9e0 fs/namespace.c:3808 do_mount fs/namespace.c:4136 [inline] __do_sys_mount fs/namespace.c:4347 [inline] __se_sys_mount+0x317/0x410 fs/namespace.c:4324 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 The buggy address belongs to the object at ffff8880443a8000 which belongs to the cache kmalloc-rcl-8k of size 8192 The buggy address is located 16 bytes to the right of allocated 8192-byte region [ffff8880443a8000, ffff8880443aa000) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x443a8 head: order:3 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 memcg:ffff888043fcf301 flags: 0x4fff00000000040(head|node=1|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 04fff00000000040 ffff88801a8483c0 dead000000000122 0000000000000000 raw: 0000000000000000 0000000080020002 00000000f5000000 ffff888043fcf301 head: 04fff00000000040 ffff88801a8483c0 dead000000000122 0000000000000000 head: 0000000000000000 0000000080020002 00000000f5000000 ffff888043fcf301 head: 04fff00000000003 ffffea000110ea01 00000000ffffffff 00000000ffffffff head: ffffffffffffffff 0000000000000000 00000000ffffffff 0000000000000008 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 3, migratetype Reclaimable, gfp_mask 0x528d0(GFP_NOWAIT|__GFP_RECLAIMABLE|__GFP_IO|__GFP_FS|__GFP_NORETRY|__GFP_COMP), pid 5360, tgid 5359 (syz.0.0), ts 85354251720, free_ts 0 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x240/0x2a0 mm/page_alloc.c:1851 prep_new_page mm/page_alloc.c:1859 [inline] get_page_from_freelist+0x21e4/0x22c0 mm/page_alloc.c:3858 __alloc_frozen_pages_noprof+0x181/0x370 mm/page_alloc.c:5148 alloc_pages_mpol+0x232/0x4a0 mm/mempolicy.c:2416 alloc_slab_page mm/slub.c:2492 [inline] allocate_slab+0x8a/0x370 mm/slub.c:2660 new_slab mm/slub.c:2714 [inline] ___slab_alloc+0xbeb/0x1420 mm/slub.c:3901 __slab_alloc mm/slub.c:3992 [inline] __slab_alloc_node mm/slub.c:4067 [inline] slab_alloc_node mm/slub.c:4228 [inline] __do_kmalloc_node mm/slub.c:4375 [inline] __kvmalloc_node_noprof+0x429/0x5f0 mm/slub.c:5067 btree_node_data_alloc+0xdc/0x270 fs/bcachefs/btree_cache.c:151 __bch2_btree_node_mem_alloc+0x1dc/0x2e0 fs/bcachefs/btree_cache.c:193 bch2_fs_btree_cache_init+0x314/0x870 fs/bcachefs/btree_cache.c:653 bch2_fs_alloc fs/bcachefs/super.c:998 [inline] bch2_fs_open+0x1ceb/0x2600 fs/bcachefs/super.c:2433 bch2_fs_get_tree+0x44f/0x1520 fs/bcachefs/fs.c:2472 vfs_get_tree+0x92/0x2b0 fs/super.c:1815 do_new_mount+0x2a2/0x9e0 fs/namespace.c:3808 do_mount fs/namespace.c:4136 [inline] __do_sys_mount fs/namespace.c:4347 [inline] __se_sys_mount+0x317/0x410 fs/namespace.c:4324 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0xfa/0x3b0 arch/x86/entry/syscall_64.c:94 page_owner free stack trace missing Memory state around the buggy address: ffff8880443a9f00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff8880443a9f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff8880443aa000: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff8880443aa080: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8880443aa100: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================