================================================================== BUG: KASAN: use-after-free in xfs_iflush_cluster+0xad/0x12a0 Read of size 8 at addr ffff8880601f9690 by task xfsaild/loop6/5531 CPU: 0 PID: 5531 Comm: xfsaild/loop6 Not tainted 5.15.169-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e3/0x2d0 lib/dump_stack.c:106 print_address_description+0x63/0x3b0 mm/kasan/report.c:248 __kasan_report mm/kasan/report.c:434 [inline] kasan_report+0x16b/0x1c0 mm/kasan/report.c:451 xfs_iflush_cluster+0xad/0x12a0 xfs_inode_item_push+0x1cd/0x2c0 fs/xfs/xfs_inode_item.c:567 xfsaild_push_item fs/xfs/xfs_trans_ail.c:414 [inline] xfsaild_push fs/xfs/xfs_trans_ail.c:472 [inline] xfsaild+0xd6d/0x2970 fs/xfs/xfs_trans_ail.c:657 kthread+0x3f6/0x4f0 kernel/kthread.c:334 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287 Allocated by task 5511: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track mm/kasan/common.c:46 [inline] set_alloc_info mm/kasan/common.c:434 [inline] __kasan_slab_alloc+0x8e/0xc0 mm/kasan/common.c:467 kasan_slab_alloc include/linux/kasan.h:254 [inline] slab_post_alloc_hook+0x53/0x380 mm/slab.h:519 slab_alloc_node mm/slub.c:3220 [inline] slab_alloc mm/slub.c:3228 [inline] kmem_cache_alloc+0xf3/0x280 mm/slub.c:3233 kmem_cache_zalloc include/linux/slab.h:711 [inline] xfs_inode_item_init+0x2f/0xc0 fs/xfs/xfs_inode_item.c:675 xfs_trans_ijoin+0xb6/0xe0 fs/xfs/libxfs/xfs_trans_inode.c:36 xfs_init_new_inode+0xd8c/0x1100 fs/xfs/xfs_inode.c:918 xfs_symlink+0xca6/0x2030 fs/xfs/xfs_symlink.c:239 xfs_vn_symlink+0x1f3/0x730 fs/xfs/xfs_iops.c:420 vfs_symlink+0x247/0x3d0 fs/namei.c:4429 do_symlinkat+0x1fd/0x600 fs/namei.c:4458 __do_sys_symlinkat fs/namei.c:4475 [inline] __se_sys_symlinkat fs/namei.c:4472 [inline] __x64_sys_symlinkat+0x95/0xa0 fs/namei.c:4472 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 Freed by task 14: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track+0x4b/0x80 mm/kasan/common.c:46 kasan_set_free_info+0x1f/0x40 mm/kasan/generic.c:360 ____kasan_slab_free+0xd8/0x120 mm/kasan/common.c:366 kasan_slab_free include/linux/kasan.h:230 [inline] slab_free_hook mm/slub.c:1705 [inline] slab_free_freelist_hook+0xdd/0x160 mm/slub.c:1731 slab_free mm/slub.c:3499 [inline] kmem_cache_free+0x91/0x1f0 mm/slub.c:3515 xfs_inode_free_callback+0x1bd/0x230 fs/xfs/xfs_icache.c:142 rcu_do_batch kernel/rcu/tree.c:2523 [inline] rcu_core+0xa15/0x1650 kernel/rcu/tree.c:2763 handle_softirqs+0x3a7/0x930 kernel/softirq.c:558 run_ksoftirqd+0xc6/0x120 kernel/softirq.c:925 smpboot_thread_fn+0x51b/0x9d0 kernel/smpboot.c:164 kthread+0x3f6/0x4f0 kernel/kthread.c:334 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:287 The buggy address belongs to the object at ffff8880601f9640 which belongs to the cache xfs_ili of size 256 The buggy address is located 80 bytes inside of 256-byte region [ffff8880601f9640, ffff8880601f9740) The buggy address belongs to the page: page:ffffea0001807e40 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff8880601f93c0 pfn:0x601f9 flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000200 0000000000000000 dead000000000122 ffff8881467fb8c0 raw: ffff8880601f93c0 00000000800c0009 00000001ffffffff 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 0x112c50(GFP_NOFS|__GFP_NOWARN|__GFP_NORETRY|__GFP_HARDWALL|__GFP_RECLAIMABLE), pid 5150, ts 113692879515, free_ts 102706795268 prep_new_page mm/page_alloc.c:2426 [inline] get_page_from_freelist+0x322a/0x33c0 mm/page_alloc.c:4159 __alloc_pages+0x272/0x700 mm/page_alloc.c:5423 alloc_slab_page mm/slub.c:1775 [inline] allocate_slab mm/slub.c:1912 [inline] new_slab+0xbb/0x4b0 mm/slub.c:1975 ___slab_alloc+0x6f6/0xe10 mm/slub.c:3008 __slab_alloc mm/slub.c:3095 [inline] slab_alloc_node mm/slub.c:3186 [inline] slab_alloc mm/slub.c:3228 [inline] kmem_cache_alloc+0x18e/0x280 mm/slub.c:3233 kmem_cache_zalloc include/linux/slab.h:711 [inline] xfs_inode_item_init+0x2f/0xc0 fs/xfs/xfs_inode_item.c:675 xfs_trans_ijoin+0xb6/0xe0 fs/xfs/libxfs/xfs_trans_inode.c:36 xfs_init_new_inode+0xd8c/0x1100 fs/xfs/xfs_inode.c:918 xfs_qm_qino_alloc+0x516/0x9c0 fs/xfs/xfs_qm.c:790 xfs_qm_init_quotainos+0x61e/0x8a0 fs/xfs/xfs_qm.c:1551 xfs_qm_init_quotainfo+0xa6/0x970 fs/xfs/xfs_qm.c:644 xfs_qm_mount_quotas+0x90/0x610 fs/xfs/xfs_qm.c:1435 xfs_mountfs+0x166a/0x1ce0 fs/xfs/xfs_mount.c:904 xfs_fs_fill_super+0x11b4/0x1400 fs/xfs/xfs_super.c:1676 get_tree_bdev+0x3fe/0x620 fs/super.c:1325 vfs_get_tree+0x88/0x270 fs/super.c:1530 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1340 [inline] free_pcp_prepare mm/page_alloc.c:1391 [inline] free_unref_page_prepare+0xc34/0xcf0 mm/page_alloc.c:3317 free_unref_page+0x95/0x2d0 mm/page_alloc.c:3396 free_slab mm/slub.c:2015 [inline] discard_slab mm/slub.c:2021 [inline] free_partial mm/slub.c:4276 [inline] __kmem_cache_shutdown+0x4b6/0x5a0 mm/slub.c:4301 shutdown_cache mm/slab_common.c:466 [inline] kmem_cache_destroy+0x3d/0x130 mm/slab_common.c:512 f2fs_put_super+0x9e1/0xd10 fs/f2fs/super.c:1645 generic_shutdown_super+0x130/0x310 fs/super.c:475 kill_block_super+0x7a/0xe0 fs/super.c:1427 kill_f2fs_super+0x2ff/0x3c0 fs/f2fs/super.c:4538 deactivate_locked_super+0xa0/0x110 fs/super.c:335 cleanup_mnt+0x44e/0x500 fs/namespace.c:1143 task_work_run+0x129/0x1a0 kernel/task_work.c:188 tracehook_notify_resume include/linux/tracehook.h:189 [inline] exit_to_user_mode_loop+0x106/0x130 kernel/entry/common.c:181 exit_to_user_mode_prepare+0xb1/0x140 kernel/entry/common.c:214 __syscall_exit_to_user_mode_work kernel/entry/common.c:296 [inline] syscall_exit_to_user_mode+0x5d/0x240 kernel/entry/common.c:307 do_syscall_64+0x47/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x66/0xd0 Memory state around the buggy address: ffff8880601f9580: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff8880601f9600: fc fc fc fc fc fc fc fc fa fb fb fb fb fb fb fb >ffff8880601f9680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8880601f9700: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff8880601f9780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================