================================================================== BUG: KASAN: slab-use-after-free in xfs_inode_item_push+0x367/0x370 fs/xfs/xfs_inode_item.c:780 Read of size 8 at addr ffff88805619e7e0 by task xfsaild/loop7/10201 CPU: 0 UID: 0 PID: 10201 Comm: xfsaild/loop7 Not tainted 6.13.0-rc1-syzkaller-00025-gfeffde684ac2 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024 Call Trace: __dump_stack lib/dump_stack.c:94 [inline] dump_stack_lvl+0x116/0x1f0 lib/dump_stack.c:120 print_address_description mm/kasan/report.c:378 [inline] print_report+0xc3/0x620 mm/kasan/report.c:489 kasan_report+0xd9/0x110 mm/kasan/report.c:602 xfs_inode_item_push+0x367/0x370 fs/xfs/xfs_inode_item.c:780 xfsaild_push_item fs/xfs/xfs_trans_ail.c:395 [inline] xfsaild_push fs/xfs/xfs_trans_ail.c:523 [inline] xfsaild+0xd69/0x3100 fs/xfs/xfs_trans_ail.c:705 kthread+0x2c4/0x3a0 kernel/kthread.c:389 ret_from_fork+0x48/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 Allocated by task 10184: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 unpoison_slab_object mm/kasan/common.c:319 [inline] __kasan_slab_alloc+0x89/0x90 mm/kasan/common.c:345 kasan_slab_alloc include/linux/kasan.h:250 [inline] slab_post_alloc_hook mm/slub.c:4104 [inline] slab_alloc_node mm/slub.c:4153 [inline] kmem_cache_alloc_noprof+0x226/0x3d0 mm/slub.c:4160 xfs_inode_item_init+0x24/0xc0 fs/xfs/xfs_inode_item.c:875 xfs_trans_ijoin+0xfc/0x160 fs/xfs/libxfs/xfs_trans_inode.c:36 xfs_create+0x993/0xd00 fs/xfs/xfs_inode.c:732 xfs_generic_create+0x6b2/0x820 fs/xfs/xfs_iops.c:215 lookup_open.isra.0+0x1177/0x14c0 fs/namei.c:3649 open_last_lookups fs/namei.c:3748 [inline] path_openat+0x904/0x2d60 fs/namei.c:3984 do_filp_open+0x20c/0x470 fs/namei.c:4014 do_sys_openat2+0x17a/0x1e0 fs/open.c:1402 do_sys_open fs/open.c:1417 [inline] __do_sys_open fs/open.c:1425 [inline] __se_sys_open fs/open.c:1421 [inline] __x64_sys_open+0x154/0x1e0 fs/open.c:1421 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 8179: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 kasan_save_free_info+0x3b/0x60 mm/kasan/generic.c:582 poison_slab_object mm/kasan/common.c:247 [inline] __kasan_slab_free+0x51/0x70 mm/kasan/common.c:264 kasan_slab_free include/linux/kasan.h:233 [inline] slab_free_hook mm/slub.c:2338 [inline] slab_free mm/slub.c:4598 [inline] kmem_cache_free+0x152/0x4c0 mm/slub.c:4700 xfs_inode_free_callback+0x159/0x240 fs/xfs/xfs_icache.c:161 rcu_do_batch kernel/rcu/tree.c:2567 [inline] rcu_core+0x7a0/0x14d0 kernel/rcu/tree.c:2823 handle_softirqs+0x216/0x8f0 kernel/softirq.c:554 __do_softirq kernel/softirq.c:588 [inline] invoke_softirq kernel/softirq.c:428 [inline] __irq_exit_rcu+0x109/0x170 kernel/softirq.c:655 irq_exit_rcu+0x9/0x30 kernel/softirq.c:671 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1049 [inline] sysvec_apic_timer_interrupt+0xa4/0xc0 arch/x86/kernel/apic/apic.c:1049 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702 The buggy address belongs to the object at ffff88805619e7b0 which belongs to the cache xfs_ili of size 264 The buggy address is located 48 bytes inside of freed 264-byte region [ffff88805619e7b0, ffff88805619e8b8) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff88805619eb88 pfn:0x5619e flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000000 ffff88801fff48c0 dead000000000122 0000000000000000 raw: ffff88805619eb88 00000000800c000a 00000001f5000000 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Reclaimable, gfp_mask 0x52c50(GFP_NOFS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_RECLAIMABLE), pid 6184, tgid 6183 (syz.3.58), ts 128102187730, free_ts 122813165915 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x2d1/0x350 mm/page_alloc.c:1556 prep_new_page mm/page_alloc.c:1564 [inline] get_page_from_freelist+0xfce/0x2f80 mm/page_alloc.c:3474 __alloc_pages_noprof+0x223/0x25b0 mm/page_alloc.c:4751 alloc_pages_mpol_noprof+0x2c9/0x610 mm/mempolicy.c:2265 alloc_slab_page mm/slub.c:2408 [inline] allocate_slab mm/slub.c:2574 [inline] new_slab+0x2c9/0x410 mm/slub.c:2627 ___slab_alloc+0xdac/0x1870 mm/slub.c:3815 __slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3905 __slab_alloc_node mm/slub.c:3980 [inline] slab_alloc_node mm/slub.c:4141 [inline] kmem_cache_alloc_noprof+0xfa/0x3d0 mm/slub.c:4160 xfs_inode_item_init+0x24/0xc0 fs/xfs/xfs_inode_item.c:875 xfs_trans_ijoin+0xfc/0x160 fs/xfs/libxfs/xfs_trans_inode.c:36 xfs_icreate+0x10c/0x170 fs/xfs/xfs_inode.c:605 xfs_qm_qino_alloc+0x2d6/0x7f0 fs/xfs/xfs_qm.c:998 xfs_qm_init_quotainos+0x56c/0x6c0 fs/xfs/xfs_qm.c:1837 xfs_qm_init_quotainfo+0xf4/0xb20 fs/xfs/xfs_qm.c:824 xfs_qm_mount_quotas+0x9c/0x6a0 fs/xfs/xfs_qm.c:1680 xfs_mountfs+0x1ed1/0x2230 fs/xfs/xfs_mount.c:1030 page last free pid 6123 tgid 6122 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1127 [inline] __free_pages_ok+0x62b/0xe40 mm/page_alloc.c:1269 __folio_put+0x32a/0x450 mm/swap.c:112 kvfree+0x47/0x50 mm/util.c:693 btree_bounce_free fs/bcachefs/btree_io.c:112 [inline] bch2_btree_node_read_done+0x3fbd/0x5030 fs/bcachefs/btree_io.c:1209 btree_node_read_work+0x567/0x1060 fs/bcachefs/btree_io.c:1323 bch2_btree_node_read+0x8aa/0xe70 fs/bcachefs/btree_io.c:1708 __bch2_btree_root_read fs/bcachefs/btree_io.c:1749 [inline] bch2_btree_root_read+0x2d2/0x470 fs/bcachefs/btree_io.c:1771 read_btree_roots fs/bcachefs/recovery.c:523 [inline] bch2_fs_recovery+0x1cc1/0x4030 fs/bcachefs/recovery.c:853 bch2_fs_start+0x2e9/0x5f0 fs/bcachefs/super.c:1037 bch2_fs_get_tree+0x10db/0x16f0 fs/bcachefs/fs.c:2170 vfs_get_tree+0x92/0x380 fs/super.c:1814 do_new_mount fs/namespace.c:3507 [inline] path_mount+0x14e6/0x1f20 fs/namespace.c:3834 do_mount fs/namespace.c:3847 [inline] __do_sys_mount fs/namespace.c:4057 [inline] __se_sys_mount fs/namespace.c:4034 [inline] __x64_sys_mount+0x294/0x320 fs/namespace.c:4034 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcd/0x250 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f Memory state around the buggy address: ffff88805619e680: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88805619e700: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc fc >ffff88805619e780: fc fc fc fc fc fc fa fb fb fb fb fb fb fb fb fb ^ ffff88805619e800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88805619e880: fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc fa ==================================================================