================================================================== BUG: KASAN: slab-use-after-free in xfs_inode_item_push+0x293/0x2e0 fs/xfs/xfs_inode_item.c:780 Read of size 8 at addr ffff88805a773928 by task xfsaild/loop1/7092 CPU: 1 UID: 0 PID: 7092 Comm: xfsaild/loop1 Not tainted 6.13.0-rc7-syzkaller-00189-g595523945be0 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 12/27/2024 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:378 [inline] print_report+0x169/0x550 mm/kasan/report.c:489 kasan_report+0x143/0x180 mm/kasan/report.c:602 xfs_inode_item_push+0x293/0x2e0 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+0x111a/0x2db0 fs/xfs/xfs_trans_ail.c:705 kthread+0x2f0/0x390 kernel/kthread.c:389 ret_from_fork+0x4b/0x80 arch/x86/kernel/process.c:147 ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:244 Allocated by task 7061: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3f/0x80 mm/kasan/common.c:68 unpoison_slab_object mm/kasan/common.c:319 [inline] __kasan_slab_alloc+0x66/0x80 mm/kasan/common.c:345 kasan_slab_alloc include/linux/kasan.h:250 [inline] slab_post_alloc_hook mm/slub.c:4119 [inline] slab_alloc_node mm/slub.c:4168 [inline] kmem_cache_alloc_noprof+0x1d9/0x380 mm/slub.c:4175 xfs_inode_item_init+0x33/0xc0 fs/xfs/xfs_inode_item.c:875 xfs_trans_ijoin+0xeb/0x130 fs/xfs/libxfs/xfs_trans_inode.c:36 xfs_icreate+0x13a/0x1f0 fs/xfs/xfs_inode.c:605 xfs_create+0x858/0xf50 fs/xfs/xfs_inode.c:721 xfs_generic_create+0x5d5/0xf50 fs/xfs/xfs_iops.c:215 lookup_open fs/namei.c:3649 [inline] open_last_lookups fs/namei.c:3748 [inline] path_openat+0x1c03/0x3590 fs/namei.c:3984 do_filp_open+0x27f/0x4e0 fs/namei.c:4014 do_sys_openat2+0x13e/0x1d0 fs/open.c:1402 do_sys_open fs/open.c:1417 [inline] __do_sys_creat fs/open.c:1495 [inline] __se_sys_creat fs/open.c:1489 [inline] __x64_sys_creat+0x123/0x170 fs/open.c:1489 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 Freed by task 5834: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3f/0x80 mm/kasan/common.c:68 kasan_save_free_info+0x40/0x50 mm/kasan/generic.c:582 poison_slab_object mm/kasan/common.c:247 [inline] __kasan_slab_free+0x59/0x70 mm/kasan/common.c:264 kasan_slab_free include/linux/kasan.h:233 [inline] slab_free_hook mm/slub.c:2353 [inline] slab_free mm/slub.c:4613 [inline] kmem_cache_free+0x195/0x410 mm/slub.c:4715 xfs_inode_free_callback+0x152/0x1d0 fs/xfs/xfs_icache.c:161 rcu_do_batch kernel/rcu/tree.c:2567 [inline] rcu_core+0xaaa/0x17a0 kernel/rcu/tree.c:2823 handle_softirqs+0x2d4/0x9b0 kernel/softirq.c:561 __do_softirq kernel/softirq.c:595 [inline] invoke_softirq kernel/softirq.c:435 [inline] __irq_exit_rcu+0xf7/0x220 kernel/softirq.c:662 irq_exit_rcu+0x9/0x30 kernel/softirq.c:678 instr_sysvec_call_function_single arch/x86/kernel/smp.c:266 [inline] sysvec_call_function_single+0xa3/0xc0 arch/x86/kernel/smp.c:266 asm_sysvec_call_function_single+0x1a/0x20 arch/x86/include/asm/idtentry.h:709 The buggy address belongs to the object at ffff88805a7738f8 which belongs to the cache xfs_ili of size 264 The buggy address is located 48 bytes inside of freed 264-byte region [ffff88805a7738f8, ffff88805a773a00) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff88805a773148 pfn:0x5a773 flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) page_type: f5(slab) raw: 00fff00000000000 ffff88801e3f33c0 dead000000000122 0000000000000000 raw: ffff88805a773148 00000000800c0007 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 6109, tgid 6108 (syz.4.33), ts 109274195486, free_ts 104913829150 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1f3/0x230 mm/page_alloc.c:1558 prep_new_page mm/page_alloc.c:1566 [inline] get_page_from_freelist+0x3651/0x37a0 mm/page_alloc.c:3476 __alloc_pages_noprof+0x292/0x710 mm/page_alloc.c:4753 alloc_pages_mpol_noprof+0x3e1/0x780 mm/mempolicy.c:2269 alloc_slab_page+0x6a/0x110 mm/slub.c:2423 allocate_slab+0x5a/0x2b0 mm/slub.c:2589 new_slab mm/slub.c:2642 [inline] ___slab_alloc+0xc27/0x14a0 mm/slub.c:3830 __slab_alloc+0x58/0xa0 mm/slub.c:3920 __slab_alloc_node mm/slub.c:3995 [inline] slab_alloc_node mm/slub.c:4156 [inline] kmem_cache_alloc_noprof+0x268/0x380 mm/slub.c:4175 xfs_inode_item_init+0x33/0xc0 fs/xfs/xfs_inode_item.c:875 xfs_trans_ijoin+0xeb/0x130 fs/xfs/libxfs/xfs_trans_inode.c:36 xfs_icreate+0x13a/0x1f0 fs/xfs/xfs_inode.c:605 xfs_qm_qino_alloc+0x2c7/0x770 fs/xfs/xfs_qm.c:1032 xfs_qm_init_quotainos+0x640/0x8a0 fs/xfs/xfs_qm.c:1881 xfs_qm_init_quotainfo+0x180/0x1260 fs/xfs/xfs_qm.c:858 xfs_qm_mount_quotas+0xe9/0x680 fs/xfs/xfs_qm.c:1724 page last free pid 5836 tgid 5836 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1127 [inline] __free_pages_ok+0xbcf/0xe50 mm/page_alloc.c:1271 __folio_put+0x2b3/0x360 mm/swap.c:112 folio_put include/linux/mm.h:1489 [inline] free_large_kmalloc+0xfe/0x180 mm/slub.c:4732 kfree+0x212/0x430 mm/slub.c:4755 __btree_node_data_free+0x30e/0x550 fs/bcachefs/btree_cache.c:110 btree_node_data_free fs/bcachefs/btree_cache.c:127 [inline] bch2_fs_btree_cache_exit+0xb1b/0x1530 fs/bcachefs/btree_cache.c:610 __bch2_fs_free fs/bcachefs/super.c:557 [inline] bch2_fs_release+0x20e/0x7d0 fs/bcachefs/super.c:611 kobject_cleanup lib/kobject.c:689 [inline] kobject_release lib/kobject.c:720 [inline] kref_put include/linux/kref.h:65 [inline] kobject_put+0x22f/0x480 lib/kobject.c:737 deactivate_locked_super+0xc4/0x130 fs/super.c:473 cleanup_mnt+0x41f/0x4b0 fs/namespace.c:1373 task_work_run+0x24f/0x310 kernel/task_work.c:239 resume_user_mode_work include/linux/resume_user_mode.h:50 [inline] exit_to_user_mode_loop kernel/entry/common.c:114 [inline] exit_to_user_mode_prepare include/linux/entry-common.h:329 [inline] __syscall_exit_to_user_mode_work kernel/entry/common.c:207 [inline] syscall_exit_to_user_mode+0x13f/0x340 kernel/entry/common.c:218 do_syscall_64+0x100/0x230 arch/x86/entry/common.c:89 entry_SYSCALL_64_after_hwframe+0x77/0x7f Memory state around the buggy address: ffff88805a773800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88805a773880: fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc fa >ffff88805a773900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88805a773980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88805a773a00: fc fc fc fc fc fc fc fc fa fb fb fb fb fb fb fb ==================================================================