================================================================== BUG: KASAN: slab-use-after-free in xfs_inode_item_push+0x293/0x2e0 fs/xfs/xfs_inode_item.c:743 Read of size 8 at addr ffff888056c1de48 by task xfsaild/loop4/15408 CPU: 0 PID: 15408 Comm: xfsaild/loop4 Not tainted 6.10.0-rc4-syzkaller-00148-g50736169ecc8 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/07/2024 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x241/0x360 lib/dump_stack.c:114 print_address_description mm/kasan/report.c:377 [inline] print_report+0x169/0x550 mm/kasan/report.c:488 kasan_report+0x143/0x180 mm/kasan/report.c:601 xfs_inode_item_push+0x293/0x2e0 fs/xfs/xfs_inode_item.c:743 xfsaild_push_item fs/xfs/xfs_trans_ail.c:414 [inline] xfsaild_push fs/xfs/xfs_trans_ail.c:486 [inline] xfsaild+0xd98/0x28b0 fs/xfs/xfs_trans_ail.c:671 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 15400: 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:312 [inline] __kasan_slab_alloc+0x66/0x80 mm/kasan/common.c:338 kasan_slab_alloc include/linux/kasan.h:201 [inline] slab_post_alloc_hook mm/slub.c:3941 [inline] slab_alloc_node mm/slub.c:4001 [inline] kmem_cache_alloc_noprof+0x135/0x2a0 mm/slub.c:4008 xfs_inode_item_init+0x33/0xc0 fs/xfs/xfs_inode_item.c:838 xfs_trans_ijoin+0xeb/0x130 fs/xfs/libxfs/xfs_trans_inode.c:36 xfs_init_new_inode+0xc23/0xf00 fs/xfs/xfs_inode.c:881 xfs_qm_qino_alloc+0x264/0x6b0 fs/xfs/xfs_qm.c:800 xfs_qm_init_quotainos+0x78d/0x8a0 fs/xfs/xfs_qm.c:1609 xfs_qm_init_quotainfo+0x138/0x1120 fs/xfs/xfs_qm.c:643 xfs_qm_mount_quotas+0x9b/0x630 fs/xfs/xfs_qm.c:1477 xfs_mountfs+0x1993/0x2020 fs/xfs/xfs_mount.c:980 xfs_fs_fill_super+0x11a6/0x1420 fs/xfs/xfs_super.c:1753 get_tree_bdev+0x3f7/0x570 fs/super.c:1615 vfs_get_tree+0x90/0x2a0 fs/super.c:1780 do_new_mount+0x2be/0xb40 fs/namespace.c:3352 do_mount fs/namespace.c:3692 [inline] __do_sys_mount fs/namespace.c:3898 [inline] __se_sys_mount+0x2d9/0x3c0 fs/namespace.c:3875 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 0: 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:579 poison_slab_object+0xe0/0x150 mm/kasan/common.c:240 __kasan_slab_free+0x37/0x60 mm/kasan/common.c:256 kasan_slab_free include/linux/kasan.h:184 [inline] slab_free_hook mm/slub.c:2196 [inline] slab_free mm/slub.c:4437 [inline] kmem_cache_free+0x145/0x350 mm/slub.c:4512 xfs_inode_free_callback+0x152/0x1d0 fs/xfs/xfs_icache.c:146 rcu_do_batch kernel/rcu/tree.c:2535 [inline] rcu_core+0xafd/0x1830 kernel/rcu/tree.c:2809 handle_softirqs+0x2c4/0x970 kernel/softirq.c:554 __do_softirq kernel/softirq.c:588 [inline] invoke_softirq kernel/softirq.c:428 [inline] __irq_exit_rcu+0xf4/0x1c0 kernel/softirq.c:637 irq_exit_rcu+0x9/0x30 kernel/softirq.c:649 instr_sysvec_apic_timer_interrupt arch/x86/kernel/apic/apic.c:1043 [inline] sysvec_apic_timer_interrupt+0xa6/0xc0 arch/x86/kernel/apic/apic.c:1043 asm_sysvec_apic_timer_interrupt+0x1a/0x20 arch/x86/include/asm/idtentry.h:702 The buggy address belongs to the object at ffff888056c1de18 which belongs to the cache xfs_ili of size 264 The buggy address is located 48 bytes inside of freed 264-byte region [ffff888056c1de18, ffff888056c1df20) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff888056c1d8f8 pfn:0x56c1d flags: 0xfff00000000000(node=0|zone=1|lastcpupid=0x7ff) page_type: 0xffffefff(slab) raw: 00fff00000000000 ffff888019779140 dead000000000122 0000000000000000 raw: ffff888056c1d8f8 00000000800c0006 00000001ffffefff 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 0x152c50(GFP_NOFS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_HARDWALL|__GFP_RECLAIMABLE), pid 6428, tgid 6427 (syz-executor.0), ts 173466681547, free_ts 153196356829 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1f3/0x230 mm/page_alloc.c:1468 prep_new_page mm/page_alloc.c:1476 [inline] get_page_from_freelist+0x2e43/0x2f00 mm/page_alloc.c:3420 __alloc_pages_noprof+0x256/0x6c0 mm/page_alloc.c:4678 __alloc_pages_node_noprof include/linux/gfp.h:269 [inline] alloc_pages_node_noprof include/linux/gfp.h:296 [inline] alloc_slab_page+0x5f/0x120 mm/slub.c:2265 allocate_slab+0x5a/0x2f0 mm/slub.c:2428 new_slab mm/slub.c:2481 [inline] ___slab_alloc+0xcd1/0x14b0 mm/slub.c:3667 __slab_alloc+0x58/0xa0 mm/slub.c:3757 __slab_alloc_node mm/slub.c:3810 [inline] slab_alloc_node mm/slub.c:3989 [inline] kmem_cache_alloc_noprof+0x1c1/0x2a0 mm/slub.c:4008 xfs_inode_item_init+0x33/0xc0 fs/xfs/xfs_inode_item.c:838 xfs_trans_ijoin+0xeb/0x130 fs/xfs/libxfs/xfs_trans_inode.c:36 xfs_trans_alloc_ichange+0x170/0x640 fs/xfs/xfs_trans.c:1375 xfs_ioctl_setattr_get_trans fs/xfs/xfs_ioctl.c:624 [inline] xfs_fileattr_set+0x55c/0x1930 fs/xfs/xfs_ioctl.c:771 vfs_fileattr_set+0x8ff/0xd50 fs/ioctl.c:697 ioctl_fssetxattr fs/ioctl.c:759 [inline] do_vfs_ioctl+0x1a9c/0x2e50 fs/ioctl.c:876 __do_sys_ioctl fs/ioctl.c:905 [inline] __se_sys_ioctl+0x81/0x170 fs/ioctl.c:893 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf3/0x230 arch/x86/entry/common.c:83 page last free pid 5724 tgid 5724 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1088 [inline] free_unref_page+0xd19/0xea0 mm/page_alloc.c:2583 __folio_put+0x3b9/0x620 mm/swap.c:129 folio_put include/linux/mm.h:1508 [inline] free_large_kmalloc+0x105/0x1c0 mm/slub.c:4529 kfree+0x1c4/0x360 mm/slub.c:4552 bch2_fs_btree_write_buffer_exit+0x102/0x1b0 fs/bcachefs/btree_write_buffer.c:651 __bch2_fs_free fs/bcachefs/super.c:565 [inline] bch2_fs_release+0x2e8/0x750 fs/bcachefs/super.c:605 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:1267 task_work_run+0x24f/0x310 kernel/task_work.c:180 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:328 [inline] __syscall_exit_to_user_mode_work kernel/entry/common.c:207 [inline] syscall_exit_to_user_mode+0x168/0x370 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: ffff888056c1dd00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888056c1dd80: fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc fc >ffff888056c1de00: fc fc fc fa fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888056c1de80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888056c1df00: fb fb fb fb fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================