================================================================== 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 ffff888078fafe48 by task xfsaild/loop3/5900 CPU: 0 PID: 5900 Comm: xfsaild/loop3 Not tainted 6.9.0-rc4-next-20240418-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/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 5889: 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:3897 [inline] slab_alloc_node mm/slub.c:3957 [inline] kmem_cache_alloc_noprof+0x135/0x290 mm/slub.c:3964 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+0xd7e/0x10b0 fs/xfs/xfs_inode.c:878 xfs_qm_qino_alloc+0x4c2/0x9b0 fs/xfs/xfs_qm.c:800 xfs_qm_init_quotainos+0x622/0x8a0 fs/xfs/xfs_qm.c:1591 xfs_qm_init_quotainfo+0x138/0x1120 fs/xfs/xfs_qm.c:643 xfs_qm_mount_quotas+0x9b/0x630 fs/xfs/xfs_qm.c:1475 xfs_mountfs+0x1849/0x1eb0 fs/xfs/xfs_mount.c:963 xfs_fs_fill_super+0x114b/0x13c0 fs/xfs/xfs_super.c:1730 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+0xf5/0x240 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f Freed by task 24: 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:2190 [inline] slab_free mm/slub.c:4393 [inline] kmem_cache_free+0x145/0x340 mm/slub.c:4468 xfs_inode_free_callback+0x152/0x1d0 fs/xfs/xfs_icache.c:146 rcu_do_batch kernel/rcu/tree.c:2565 [inline] rcu_core+0xafd/0x1830 kernel/rcu/tree.c:2839 __do_softirq+0x2c6/0x980 kernel/softirq.c:554 The buggy address belongs to the object at ffff888078fafe18 which belongs to the cache xfs_ili of size 264 The buggy address is located 48 bytes inside of freed 264-byte region [ffff888078fafe18, ffff888078faff20) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x78faf flags: 0xfff80000000000(node=0|zone=1|lastcpupid=0xfff) page_type: 0xffffefff(slab) raw: 00fff80000000000 ffff88801af79140 dead000000000122 0000000000000000 raw: 0000000000000000 00000000800c000c 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 5270, tgid 1360360767 (syz-executor.0), ts 5271, free_ts 86974657492 set_page_owner include/linux/page_owner.h:32 [inline] post_alloc_hook+0x1f3/0x230 mm/page_alloc.c:1476 prep_new_page mm/page_alloc.c:1484 [inline] get_page_from_freelist+0x2ce2/0x2d90 mm/page_alloc.c:3446 __alloc_pages_noprof+0x256/0x6c0 mm/page_alloc.c:4704 __alloc_pages_node_noprof include/linux/gfp.h:244 [inline] alloc_pages_node_noprof include/linux/gfp.h:271 [inline] alloc_slab_page+0x5f/0x120 mm/slub.c:2259 allocate_slab+0x5a/0x2e0 mm/slub.c:2422 new_slab mm/slub.c:2475 [inline] ___slab_alloc+0xcd1/0x14b0 mm/slub.c:3624 __slab_alloc+0x58/0xa0 mm/slub.c:3714 __slab_alloc_node mm/slub.c:3767 [inline] slab_alloc_node mm/slub.c:3945 [inline] kmem_cache_alloc_noprof+0x1c1/0x290 mm/slub.c:3964 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_rename+0x9b6/0x2200 fs/xfs/xfs_inode.c:3048 xfs_vn_rename+0x388/0x4e0 fs/xfs/xfs_iops.c:474 vfs_rename+0xbdb/0xf00 fs/namei.c:4887 do_renameat2+0xd94/0x13f0 fs/namei.c:5044 __do_sys_renameat2 fs/namei.c:5078 [inline] __se_sys_renameat2 fs/namei.c:5075 [inline] __x64_sys_renameat2+0xd2/0xf0 fs/namei.c:5075 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf5/0x240 arch/x86/entry/common.c:83 page last free pid 5106 tgid 5106 stack trace: reset_page_owner include/linux/page_owner.h:25 [inline] free_pages_prepare mm/page_alloc.c:1096 [inline] free_unref_page+0xd22/0xea0 mm/page_alloc.c:2609 __slab_free+0x31b/0x3d0 mm/slub.c:4304 qlink_free mm/kasan/quarantine.c:163 [inline] qlist_free_all+0x9e/0x140 mm/kasan/quarantine.c:179 kasan_quarantine_reduce+0x14f/0x170 mm/kasan/quarantine.c:286 __kasan_slab_alloc+0x23/0x80 mm/kasan/common.c:322 kasan_slab_alloc include/linux/kasan.h:201 [inline] slab_post_alloc_hook mm/slub.c:3897 [inline] slab_alloc_node mm/slub.c:3957 [inline] kmalloc_trace_noprof+0x132/0x2b0 mm/slub.c:4104 kmalloc_noprof include/linux/slab.h:660 [inline] kzalloc_noprof include/linux/slab.h:778 [inline] kernfs_fop_open+0x3e0/0xd10 fs/kernfs/file.c:623 do_dentry_open+0x95a/0x1720 fs/open.c:955 do_open fs/namei.c:3650 [inline] path_openat+0x289f/0x3280 fs/namei.c:3807 do_filp_open+0x235/0x490 fs/namei.c:3834 do_sys_openat2+0x13e/0x1d0 fs/open.c:1405 do_sys_open fs/open.c:1420 [inline] __do_sys_openat fs/open.c:1436 [inline] __se_sys_openat fs/open.c:1431 [inline] __x64_sys_openat+0x247/0x2a0 fs/open.c:1431 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf5/0x240 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f Memory state around the buggy address: ffff888078fafd00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888078fafd80: fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc fc >ffff888078fafe00: fc fc fc fa fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888078fafe80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888078faff00: fb fb fb fb fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================