================================================================== 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 ffff0000ddd3c4e8 by task xfsaild/loop0/5884 CPU: 1 PID: 5884 Comm: xfsaild/loop0 Not tainted 5.15.172-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/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 5827: 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_create+0x754/0xfec fs/xfs/xfs_inode.c:1044 xfs_generic_create+0x390/0xb10 fs/xfs/xfs_iops.c:197 xfs_vn_mkdir+0x44/0x58 fs/xfs/xfs_iops.c:285 vfs_mkdir+0x334/0x4e4 fs/namei.c:4065 do_mkdirat+0x20c/0x610 fs/namei.c:4090 __do_sys_mkdirat fs/namei.c:4105 [inline] __se_sys_mkdirat fs/namei.c:4103 [inline] __arm64_sys_mkdirat+0x90/0xa8 fs/namei.c:4103 __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 14: 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 run_ksoftirqd+0x6c/0x29c kernel/softirq.c:925 smpboot_thread_fn+0x4b0/0x920 kernel/smpboot.c:164 kthread+0x37c/0x45c kernel/kthread.c:334 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:870 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/0x2f0 fs/super.c:475 kill_block_super+0x70/0xdc fs/super.c:1427 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/0x2f0 fs/super.c:475 kill_block_super+0x70/0xdc fs/super.c:1427 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 ffff0000ddd3c380 which belongs to the cache xfs_inode of size 1752 The buggy address is located 360 bytes inside of 1752-byte region [ffff0000ddd3c380, ffff0000ddd3ca58) The buggy address belongs to the page: page:000000009d9f3c8b refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff0000ddd39680 pfn:0x11dd38 head:000000009d9f3c8b order:3 compound_mapcount:0 compound_pincount:0 memcg:ffff0000d8b63001 flags: 0x5ffc00000010200(slab|head|node=0|zone=2|lastcpupid=0x7ff) raw: 05ffc00000010200 0000000000000000 dead000000000122 ffff0000c6908300 raw: ffff0000ddd39680 0000000080110008 00000001ffffffff ffff0000d8b63001 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff0000ddd3c380: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff0000ddd3c400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff0000ddd3c480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff0000ddd3c500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff0000ddd3c580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================