================================================================== BUG: KASAN: use-after-free in __xfs_iflags_test fs/xfs/xfs_inode.h:146 [inline] BUG: KASAN: use-after-free in xfs_iflush_cluster+0xd0/0x113c fs/xfs/xfs_inode.c:3650 Read of size 8 at addr ffff0000e6e66a68 by task xfsaild/loop1/5757 CPU: 0 PID: 5757 Comm: xfsaild/loop1 Not tainted 5.15.167-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 08/06/2024 Call trace: dump_backtrace+0x0/0x530 arch/arm64/kernel/stacktrace.c:152 show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:216 __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x108/0x170 lib/dump_stack.c:106 print_address_description+0x7c/0x3f0 mm/kasan/report.c:248 __kasan_report mm/kasan/report.c:434 [inline] kasan_report+0x174/0x1e4 mm/kasan/report.c:451 __asan_report_load8_noabort+0x44/0x50 mm/kasan/report_generic.c:309 __xfs_iflags_test fs/xfs/xfs_inode.h:146 [inline] xfs_iflush_cluster+0xd0/0x113c fs/xfs/xfs_inode.c:3650 xfs_inode_item_push+0x190/0x28c 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+0xb58/0x2bfc fs/xfs/xfs_trans_ail.c:657 kthread+0x37c/0x45c kernel/kthread.c:334 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:870 Allocated by task 5710: 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+0x8c/0xcc mm/kasan/common.c:467 kasan_slab_alloc include/linux/kasan.h:254 [inline] slab_post_alloc_hook+0x74/0x3f4 mm/slab.h:519 slab_alloc_node mm/slub.c:3220 [inline] slab_alloc mm/slub.c:3228 [inline] kmem_cache_alloc+0x1dc/0x45c mm/slub.c:3233 xfs_inode_alloc+0x64/0x538 fs/xfs/xfs_icache.c:80 xfs_iget_cache_miss fs/xfs/xfs_icache.c:601 [inline] xfs_iget+0xa00/0x2f28 fs/xfs/xfs_icache.c:767 xfs_init_new_inode+0x1a0/0xd58 fs/xfs/xfs_inode.c:830 xfs_symlink+0x9f0/0x1a20 fs/xfs/xfs_symlink.c:239 xfs_vn_symlink+0x1b4/0x644 fs/xfs/xfs_iops.c:420 vfs_symlink+0x244/0x3a8 fs/namei.c:4429 do_symlinkat+0x364/0x6b0 fs/namei.c:4458 __do_sys_symlinkat fs/namei.c:4475 [inline] __se_sys_symlinkat fs/namei.c:4472 [inline] __arm64_sys_symlinkat+0xa4/0xbc fs/namei.c:4472 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline] invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:52 el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:142 do_el0_svc+0x58/0x14c arch/arm64/kernel/syscall.c:181 el0_svc+0x7c/0x1f0 arch/arm64/kernel/entry-common.c:608 el0t_64_sync_handler+0x84/0xe4 arch/arm64/kernel/entry-common.c:626 el0t_64_sync+0x1a0/0x1a4 arch/arm64/kernel/entry.S:584 Freed by task 9: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track+0x4c/0x84 mm/kasan/common.c:46 kasan_set_free_info+0x28/0x4c mm/kasan/generic.c:360 ____kasan_slab_free+0x118/0x164 mm/kasan/common.c:366 __kasan_slab_free+0x18/0x28 mm/kasan/common.c:374 kasan_slab_free include/linux/kasan.h:230 [inline] slab_free_hook mm/slub.c:1705 [inline] slab_free_freelist_hook+0x128/0x1ec mm/slub.c:1731 slab_free mm/slub.c:3499 [inline] kmem_cache_free+0xdc/0x3c4 mm/slub.c:3515 xfs_inode_free_callback+0x218/0x240 fs/xfs/xfs_icache.c:146 rcu_do_batch kernel/rcu/tree.c:2523 [inline] rcu_core+0x830/0x1b34 kernel/rcu/tree.c:2763 rcu_core_si+0x10/0x1c kernel/rcu/tree.c:2776 handle_softirqs+0x384/0xdbc kernel/softirq.c:558 __do_softirq kernel/softirq.c:592 [inline] do_softirq_own_stack include/asm-generic/softirq_stack.h:10 [inline] invoke_softirq kernel/softirq.c:439 [inline] __irq_exit_rcu+0x268/0x4d8 kernel/softirq.c:641 irq_exit+0x14/0x88 kernel/softirq.c:665 handle_domain_irq+0xf4/0x178 kernel/irq/irqdesc.c:711 gic_handle_irq+0x78/0x1c8 drivers/irqchip/irq-gic-v3.c:758 Last potentially related work creation: kasan_save_stack+0x38/0x68 mm/kasan/common.c:38 kasan_record_aux_stack+0xd4/0x11c mm/kasan/generic.c:348 __call_rcu kernel/rcu/tree.c:3007 [inline] call_rcu+0x118/0xb40 kernel/rcu/tree.c:3087 __xfs_inode_free+0x194/0x240 fs/xfs/xfs_icache.c:158 xfs_reclaim_inode fs/xfs/xfs_icache.c:960 [inline] xfs_icwalk_process_inode fs/xfs/xfs_icache.c:1642 [inline] xfs_icwalk_ag+0xf7c/0x167c fs/xfs/xfs_icache.c:1724 xfs_icwalk fs/xfs/xfs_icache.c:1773 [inline] xfs_reclaim_inodes+0x1ac/0x2d0 fs/xfs/xfs_icache.c:993 xfs_unmount_flush_inodes+0xc0/0x104 fs/xfs/xfs_mount.c:554 xfs_unmountfs+0xc0/0x1c8 fs/xfs/xfs_mount.c:1016 xfs_fs_put_super+0x70/0x250 fs/xfs/xfs_super.c:1096 generic_shutdown_super+0x130/0x29c fs/super.c:475 kill_block_super+0x70/0xdc fs/super.c:1425 deactivate_locked_super+0xb8/0x13c fs/super.c:335 deactivate_super+0x108/0x128 fs/super.c:366 cleanup_mnt+0x3c0/0x474 fs/namespace.c:1143 __cleanup_mnt+0x20/0x30 fs/namespace.c:1150 task_work_run+0x130/0x1e4 kernel/task_work.c:188 tracehook_notify_resume include/linux/tracehook.h:189 [inline] do_notify_resume+0x262c/0x32b8 arch/arm64/kernel/signal.c:946 prepare_exit_to_user_mode arch/arm64/kernel/entry-common.c:133 [inline] exit_to_user_mode arch/arm64/kernel/entry-common.c:138 [inline] el0_svc+0xfc/0x1f0 arch/arm64/kernel/entry-common.c:609 el0t_64_sync_handler+0x84/0xe4 arch/arm64/kernel/entry-common.c:626 el0t_64_sync+0x1a0/0x1a4 arch/arm64/kernel/entry.S:584 Second to last potentially related work creation: kasan_save_stack+0x38/0x68 mm/kasan/common.c:38 kasan_record_aux_stack+0xd4/0x11c mm/kasan/generic.c:348 __call_rcu kernel/rcu/tree.c:3007 [inline] call_rcu+0x118/0xb40 kernel/rcu/tree.c:3087 __xfs_inode_free+0x194/0x240 fs/xfs/xfs_icache.c:158 xfs_reclaim_inode fs/xfs/xfs_icache.c:960 [inline] xfs_icwalk_process_inode fs/xfs/xfs_icache.c:1642 [inline] xfs_icwalk_ag+0xf7c/0x167c fs/xfs/xfs_icache.c:1724 xfs_icwalk fs/xfs/xfs_icache.c:1773 [inline] xfs_reclaim_inodes+0x1ac/0x2d0 fs/xfs/xfs_icache.c:993 xfs_unmount_flush_inodes+0xc0/0x104 fs/xfs/xfs_mount.c:554 xfs_unmountfs+0xc0/0x1c8 fs/xfs/xfs_mount.c:1016 xfs_fs_put_super+0x70/0x250 fs/xfs/xfs_super.c:1096 generic_shutdown_super+0x130/0x29c fs/super.c:475 kill_block_super+0x70/0xdc fs/super.c:1425 deactivate_locked_super+0xb8/0x13c fs/super.c:335 deactivate_super+0x108/0x128 fs/super.c:366 cleanup_mnt+0x3c0/0x474 fs/namespace.c:1143 __cleanup_mnt+0x20/0x30 fs/namespace.c:1150 task_work_run+0x130/0x1e4 kernel/task_work.c:188 tracehook_notify_resume include/linux/tracehook.h:189 [inline] do_notify_resume+0x262c/0x32b8 arch/arm64/kernel/signal.c:946 prepare_exit_to_user_mode arch/arm64/kernel/entry-common.c:133 [inline] exit_to_user_mode arch/arm64/kernel/entry-common.c:138 [inline] el0_svc+0xfc/0x1f0 arch/arm64/kernel/entry-common.c:609 el0t_64_sync_handler+0x84/0xe4 arch/arm64/kernel/entry-common.c:626 el0t_64_sync+0x1a0/0x1a4 arch/arm64/kernel/entry.S:584 The buggy address belongs to the object at ffff0000e6e66900 which belongs to the cache xfs_inode of size 1752 The buggy address is located 360 bytes inside of 1752-byte region [ffff0000e6e66900, ffff0000e6e66fd8) The buggy address belongs to the page: page:0000000071ff3fe7 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x126e60 head:0000000071ff3fe7 order:3 compound_mapcount:0 compound_pincount:0 memcg:ffff0000d6d26601 flags: 0x5ffc00000010200(slab|head|node=0|zone=2|lastcpupid=0x7ff) raw: 05ffc00000010200 0000000000000000 0000000100000001 ffff0000c6892c00 raw: 0000000000000000 0000000080110011 00000001ffffffff ffff0000d6d26601 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff0000e6e66900: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff0000e6e66980: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff0000e6e66a00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff0000e6e66a80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff0000e6e66b00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================