bcachefs (loop0): error validating btree node at btree extents level 0/0 u64s 11 type btree_ptr_v2 SPOS_MAX len 0 ver 0: seq c6c25c03258c59c5 written 48 min_key 0:36028797018963968:0 durability: 1 ptr: 0:27:0 gen 0 node offset 8/48 bset u64s 2097 bset byte offset 40: bad k->u64s 0 (min 3 max 253), fixing invalid bkey in btree_node btree=extents level=0: u64s 10 type deleted 8825211592396076079:4100:0 len 0 ver 0: snapshot == 0: delete?, fixing bcachefs (loop0): error validating btree node at btree extents level 0/0 u64s 11 type btree_ptr_v2 SPOS_MAX len 0 ver 0: seq c6c25c03258c59c5 written 48 min_key 0:36028797018963968:0 durability: 1 ptr: 0:27:0 gen 0 node offset 8/48 bset u64s 2088 bset byte offset 360: bad k->u64s 0 (min 3 max 253), fixing ================================================================== BUG: KASAN: slab-out-of-bounds in bkey_packed_valid+0x488/0x6c0 fs/bcachefs/btree_io.c:865 Read of size 1 at addr ffff8880446e0240 by task kworker/0:1H/36 CPU: 0 UID: 0 PID: 36 Comm: kworker/0:1H Not tainted 6.14.0-rc4-syzkaller-00282-g1973160c90d7 #0 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014 Workqueue: bcachefs_btree_read_complete btree_node_read_work Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:408 [inline] print_report+0x16e/0x5b0 mm/kasan/report.c:521 kasan_report+0x143/0x180 mm/kasan/report.c:634 bkey_packed_valid+0x488/0x6c0 fs/bcachefs/btree_io.c:865 validate_bset_keys+0xeb5/0x1af0 fs/bcachefs/btree_io.c:987 bch2_btree_node_read_done+0x2298/0x6180 fs/bcachefs/btree_io.c:1164 btree_node_read_work+0x6dc/0x1380 fs/bcachefs/btree_io.c:1358 process_one_work kernel/workqueue.c:3238 [inline] process_scheduled_works+0xabe/0x18e0 kernel/workqueue.c:3319 worker_thread+0x870/0xd30 kernel/workqueue.c:3400 kthread+0x7a9/0x920 kernel/kthread.c:464 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:148 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 The buggy address belongs to the object at ffff8880446e0000 which belongs to the cache radix_tree_node of size 576 The buggy address is located 0 bytes to the right of allocated 576-byte region [ffff8880446e0000, ffff8880446e0240) The buggy address belongs to the physical page: page: refcount:0 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x446e0 head: order:1 mapcount:0 entire_mapcount:0 nr_pages_mapped:0 pincount:0 memcg:ffff888032ea6d81 flags: 0x4fff00000000040(head|node=1|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 04fff00000000040 ffff88801b04fdc0 dead000000000122 0000000000000000 raw: 0000000000000000 00000000000b000b 00000000f5000000 ffff888032ea6d81 head: 04fff00000000040 ffff88801b04fdc0 dead000000000122 0000000000000000 head: 0000000000000000 00000000000b000b 00000000f5000000 ffff888032ea6d81 head: 04fff00000000001 ffffea000111b801 ffffffffffffffff 0000000000000000 head: 0000000000000002 0000000000000000 00000000ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 1, migratetype Reclaimable, gfp_mask 0x52830(GFP_ATOMIC|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_RECLAIMABLE), pid 5302, tgid 5302 (syz-executor), ts 66395867391, free_ts 0 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1f4/0x240 mm/page_alloc.c:1551 prep_new_page mm/page_alloc.c:1559 [inline] get_page_from_freelist+0x365c/0x37a0 mm/page_alloc.c:3477 __alloc_frozen_pages_noprof+0x292/0x710 mm/page_alloc.c:4739 alloc_pages_mpol+0x311/0x660 mm/mempolicy.c:2270 alloc_slab_page mm/slub.c:2423 [inline] allocate_slab+0x8f/0x3a0 mm/slub.c:2587 new_slab mm/slub.c:2640 [inline] ___slab_alloc+0xc27/0x14a0 mm/slub.c:3826 __slab_alloc+0x58/0xa0 mm/slub.c:3916 __slab_alloc_node mm/slub.c:3991 [inline] slab_alloc_node mm/slub.c:4152 [inline] kmem_cache_alloc_noprof+0x268/0x380 mm/slub.c:4171 radix_tree_node_alloc+0x19a/0x3c0 lib/radix-tree.c:253 idr_get_free+0x296/0xab0 lib/radix-tree.c:1506 idr_alloc_u32+0x195/0x330 lib/idr.c:46 idr_alloc_cyclic+0x106/0x300 lib/idr.c:125 __kernfs_new_node+0x12d/0x870 fs/kernfs/dir.c:630 kernfs_new_node+0x137/0x240 fs/kernfs/dir.c:700 __kernfs_create_file+0x49/0x2e0 fs/kernfs/file.c:1034 cgroup_add_file kernel/cgroup/cgroup.c:4247 [inline] cgroup_addrm_files+0x87a/0xbb0 kernel/cgroup/cgroup.c:4301 page_owner free stack trace missing Memory state around the buggy address: ffff8880446e0100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff8880446e0180: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff8880446e0200: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc ^ ffff8880446e0280: fc fc fc fc fc fc fc fc 00 00 00 00 00 00 00 00 ffff8880446e0300: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ==================================================================