================================================================== BUG: KASAN: use-after-free in iomap_finish_ioend+0xb1c/0xbf4 fs/iomap/buffered-io.c:1319 Read of size 8 at addr ffff0000ec274010 by task kworker/0:10/4636 CPU: 0 PID: 4636 Comm: kworker/0:10 Not tainted 6.1.97-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 06/07/2024 Workqueue: xfs-conv/loop2 xfs_end_io Call trace: dump_backtrace+0x1c8/0x1f4 arch/arm64/kernel/stacktrace.c:158 show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:165 __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x108/0x170 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:284 [inline] print_report+0x174/0x4c0 mm/kasan/report.c:395 kasan_report+0xd4/0x130 mm/kasan/report.c:495 __asan_report_load8_noabort+0x2c/0x38 mm/kasan/report_generic.c:351 iomap_finish_ioend+0xb1c/0xbf4 fs/iomap/buffered-io.c:1319 iomap_finish_ioends+0x164/0x31c fs/iomap/buffered-io.c:1343 xfs_end_ioend+0x2c0/0x404 fs/xfs/xfs_aops.c:134 xfs_end_io+0x258/0x2ec fs/xfs/xfs_aops.c:171 process_one_work+0x7ac/0x1404 kernel/workqueue.c:2292 worker_thread+0x8e4/0xfec kernel/workqueue.c:2439 kthread+0x250/0x2d8 kernel/kthread.c:376 ret_from_fork+0x10/0x20 arch/arm64/kernel/entry.S:864 Allocated by task 9334: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4c/0x80 mm/kasan/common.c:52 kasan_save_alloc_info+0x24/0x30 mm/kasan/generic.c:505 __kasan_slab_alloc+0x74/0x8c mm/kasan/common.c:328 kasan_slab_alloc include/linux/kasan.h:201 [inline] slab_post_alloc_hook+0x74/0x458 mm/slab.h:737 slab_alloc_node mm/slub.c:3398 [inline] slab_alloc mm/slub.c:3406 [inline] __kmem_cache_alloc_lru mm/slub.c:3413 [inline] kmem_cache_alloc_lru+0x1ac/0x2f8 mm/slub.c:3429 alloc_inode_sb include/linux/fs.h:3193 [inline] xfs_inode_alloc+0x84/0x63c fs/xfs/xfs_icache.c:81 xfs_iget_cache_miss fs/xfs/xfs_icache.c:590 [inline] xfs_iget+0x9fc/0x3200 fs/xfs/xfs_icache.c:756 xfs_lookup+0x288/0x548 fs/xfs/xfs_inode.c:669 xfs_vn_lookup+0x14c/0x244 fs/xfs/xfs_iops.c:304 lookup_open fs/namei.c:3462 [inline] open_last_lookups fs/namei.c:3552 [inline] path_openat+0xd3c/0x2548 fs/namei.c:3782 do_filp_open+0x1bc/0x3cc fs/namei.c:3812 do_sys_openat2+0x128/0x3d8 fs/open.c:1318 do_sys_open fs/open.c:1334 [inline] __do_sys_openat fs/open.c:1350 [inline] __se_sys_openat fs/open.c:1345 [inline] __arm64_sys_openat+0x1f0/0x240 fs/open.c:1345 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline] invoke_syscall+0x98/0x2c0 arch/arm64/kernel/syscall.c:52 el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:140 do_el0_svc+0x64/0x218 arch/arm64/kernel/syscall.c:204 el0_svc+0x58/0x168 arch/arm64/kernel/entry-common.c:637 el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655 el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:585 Freed by task 9384: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4c/0x80 mm/kasan/common.c:52 kasan_save_free_info+0x38/0x5c mm/kasan/generic.c:516 ____kasan_slab_free+0x144/0x1c0 mm/kasan/common.c:236 __kasan_slab_free+0x18/0x28 mm/kasan/common.c:244 kasan_slab_free include/linux/kasan.h:177 [inline] slab_free_hook mm/slub.c:1724 [inline] slab_free_freelist_hook mm/slub.c:1750 [inline] slab_free mm/slub.c:3661 [inline] kmem_cache_free+0x2f0/0x588 mm/slub.c:3683 xfs_inode_free_callback+0x1a8/0x1cc fs/xfs/xfs_icache.c:149 rcu_do_batch kernel/rcu/tree.c:2296 [inline] rcu_core+0x878/0x1c24 kernel/rcu/tree.c:2556 rcu_core_si+0x10/0x1c kernel/rcu/tree.c:2573 handle_softirqs+0x318/0xd58 kernel/softirq.c:571 __do_softirq+0x14/0x20 kernel/softirq.c:605 Last potentially related work creation: kasan_save_stack+0x40/0x70 mm/kasan/common.c:45 __kasan_record_aux_stack+0xcc/0xe8 mm/kasan/generic.c:486 kasan_record_aux_stack_noalloc+0x14/0x20 mm/kasan/generic.c:496 call_rcu+0xfc/0xa40 kernel/rcu/tree.c:2844 __xfs_inode_free+0x194/0x240 fs/xfs/xfs_icache.c:161 xfs_reclaim_inode fs/xfs/xfs_icache.c:958 [inline] xfs_icwalk_process_inode fs/xfs/xfs_icache.c:1640 [inline] xfs_icwalk_ag+0xf54/0x168c fs/xfs/xfs_icache.c:1722 xfs_icwalk fs/xfs/xfs_icache.c:1771 [inline] xfs_reclaim_inodes+0x1ac/0x2d0 fs/xfs/xfs_icache.c:991 xfs_unmount_flush_inodes+0xbc/0xf4 fs/xfs/xfs_mount.c:594 xfs_unmountfs+0xc4/0x268 fs/xfs/xfs_mount.c:1071 xfs_fs_put_super+0x78/0x260 fs/xfs/xfs_super.c:1118 generic_shutdown_super+0x130/0x328 fs/super.c:501 kill_block_super+0x70/0xdc fs/super.c:1459 deactivate_locked_super+0xac/0x124 fs/super.c:332 deactivate_super+0xf0/0x110 fs/super.c:363 cleanup_mnt+0x394/0x41c fs/namespace.c:1186 __cleanup_mnt+0x20/0x30 fs/namespace.c:1193 task_work_run+0x240/0x2f0 kernel/task_work.c:179 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline] do_notify_resume+0x2148/0x3474 arch/arm64/kernel/signal.c:1132 prepare_exit_to_user_mode arch/arm64/kernel/entry-common.c:137 [inline] exit_to_user_mode arch/arm64/kernel/entry-common.c:142 [inline] el0_svc+0x9c/0x168 arch/arm64/kernel/entry-common.c:638 el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655 el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:585 Second to last potentially related work creation: kasan_save_stack+0x40/0x70 mm/kasan/common.c:45 __kasan_record_aux_stack+0xcc/0xe8 mm/kasan/generic.c:486 kasan_record_aux_stack_noalloc+0x14/0x20 mm/kasan/generic.c:496 insert_work+0x64/0x384 kernel/workqueue.c:1361 __queue_work+0xd48/0x136c kernel/workqueue.c:1520 queue_work_on+0xc0/0x16c kernel/workqueue.c:1548 queue_work include/linux/workqueue.h:512 [inline] xfs_end_bio+0xe4/0x1dc fs/xfs/xfs_aops.c:186 bio_endio+0x7c8/0x80c block/bio.c:1554 iomap_submit_ioend fs/iomap/buffered-io.c:1458 [inline] iomap_writepages+0x198/0x1f4 fs/iomap/buffered-io.c:1790 xfs_vm_writepages+0x134/0x198 fs/xfs/xfs_aops.c:503 do_writepages+0x2e8/0x56c mm/page-writeback.c:2469 filemap_fdatawrite_wbc+0x124/0x174 mm/filemap.c:388 __filemap_fdatawrite_range mm/filemap.c:421 [inline] file_write_and_wait_range+0x19c/0x28c mm/filemap.c:774 xfs_file_fsync+0x1c8/0xa14 fs/xfs/xfs_file.c:151 vfs_fsync_range+0x168/0x188 fs/sync.c:188 generic_write_sync include/linux/fs.h:2957 [inline] xfs_file_buffered_write+0xa4c/0xba8 fs/xfs/xfs_file.c:764 xfs_file_write_iter+0x2b4/0x604 fs/xfs/xfs_file.c:802 call_write_iter include/linux/fs.h:2265 [inline] new_sync_write fs/read_write.c:491 [inline] vfs_write+0x610/0x914 fs/read_write.c:584 ksys_write+0x15c/0x26c fs/read_write.c:637 __do_sys_write fs/read_write.c:649 [inline] __se_sys_write fs/read_write.c:646 [inline] __arm64_sys_write+0x7c/0x90 fs/read_write.c:646 __invoke_syscall arch/arm64/kernel/syscall.c:38 [inline] invoke_syscall+0x98/0x2c0 arch/arm64/kernel/syscall.c:52 el0_svc_common+0x138/0x258 arch/arm64/kernel/syscall.c:140 do_el0_svc+0x64/0x218 arch/arm64/kernel/syscall.c:204 el0_svc+0x58/0x168 arch/arm64/kernel/entry-common.c:637 el0t_64_sync_handler+0x84/0xf0 arch/arm64/kernel/entry-common.c:655 el0t_64_sync+0x18c/0x190 arch/arm64/kernel/entry.S:585 The buggy address belongs to the object at ffff0000ec273e00 which belongs to the cache xfs_inode of size 1808 The buggy address is located 528 bytes inside of 1808-byte region [ffff0000ec273e00, ffff0000ec274510) The buggy address belongs to the physical page: page:000000005b0e50f5 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff0000ec274d80 pfn:0x12c270 head:000000005b0e50f5 order:3 compound_mapcount:0 compound_pincount:0 memcg:ffff0000ecf59b01 flags: 0x5ffc00000010200(slab|head|node=0|zone=2|lastcpupid=0x7ff) raw: 05ffc00000010200 0000000000000000 dead000000000122 ffff0000c6e38a80 raw: ffff0000ec274d80 0000000080100004 00000001ffffffff ffff0000ecf59b01 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff0000ec273f00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff0000ec273f80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff0000ec274000: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff0000ec274080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff0000ec274100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================