R10: 0000555557283773 R11: 0000000000000246 R12: 00007fcf384e6cdc R13: 00007ffff0e005b0 R14: 00005555572836f0 R15: 00007ffff0e005f0 ---[ end trace 0000000000000000 ]--- ================================================================== BUG: KASAN: use-after-free in instrument_atomic_read_write include/linux/instrumented.h:102 [inline] BUG: KASAN: use-after-free in atomic_try_cmpxchg_acquire include/linux/atomic/atomic-instrumented.h:541 [inline] BUG: KASAN: use-after-free in queued_spin_lock include/asm-generic/qspinlock.h:111 [inline] BUG: KASAN: use-after-free in do_raw_spin_lock include/linux/spinlock.h:186 [inline] BUG: KASAN: use-after-free in __raw_spin_lock include/linux/spinlock_api_smp.h:134 [inline] BUG: KASAN: use-after-free in _raw_spin_lock+0x97/0x1b0 kernel/locking/spinlock.c:154 Write of size 4 at addr ffff888122e36f80 by task syz-executor.0/435 CPU: 0 PID: 435 Comm: syz-executor.0 Tainted: G W 6.1.0-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/25/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x105/0x148 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:284 [inline] print_report+0x158/0x4e0 mm/kasan/report.c:395 kasan_report+0x13c/0x170 mm/kasan/report.c:495 kasan_check_range+0x294/0x2a0 mm/kasan/generic.c:189 __kasan_check_write+0x14/0x20 mm/kasan/shadow.c:37 instrument_atomic_read_write include/linux/instrumented.h:102 [inline] atomic_try_cmpxchg_acquire include/linux/atomic/atomic-instrumented.h:541 [inline] queued_spin_lock include/asm-generic/qspinlock.h:111 [inline] do_raw_spin_lock include/linux/spinlock.h:186 [inline] __raw_spin_lock include/linux/spinlock_api_smp.h:134 [inline] _raw_spin_lock+0x97/0x1b0 kernel/locking/spinlock.c:154 spin_lock include/linux/spinlock.h:350 [inline] igrab+0x1b/0x80 fs/inode.c:1388 f2fs_sync_inode_meta+0x13f/0x250 fs/f2fs/checkpoint.c:1154 block_operations fs/f2fs/checkpoint.c:1262 [inline] f2fs_write_checkpoint+0xacb/0x1ee0 fs/f2fs/checkpoint.c:1655 f2fs_issue_checkpoint+0x2fb/0x460 f2fs_sync_fs+0x109/0x200 fs/f2fs/super.c:1668 sync_filesystem+0x172/0x1b0 fs/sync.c:66 f2fs_quota_off_umount+0x1ba/0x1d0 fs/f2fs/super.c:2877 f2fs_put_super+0xb7/0xa70 fs/f2fs/super.c:1555 generic_shutdown_super+0x113/0x2a0 fs/super.c:492 kill_block_super+0x79/0xc0 fs/super.c:1428 kill_f2fs_super+0x252/0x320 fs/f2fs/super.c:4631 deactivate_locked_super+0x75/0xd0 fs/super.c:332 deactivate_super+0x5d/0x80 fs/super.c:363 cleanup_mnt+0x3d3/0x450 fs/namespace.c:1186 __cleanup_mnt+0xd/0x10 fs/namespace.c:1193 task_work_run+0x208/0x260 kernel/task_work.c:179 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline] exit_to_user_mode_loop+0x8b/0xa0 kernel/entry/common.c:171 exit_to_user_mode_prepare+0x5a/0xa0 kernel/entry/common.c:203 __syscall_exit_to_user_mode_work kernel/entry/common.c:285 [inline] syscall_exit_to_user_mode+0x26/0x130 kernel/entry/common.c:296 do_syscall_64+0x49/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7fcf3848d5d7 Code: ff ff ff f7 d8 64 89 01 48 83 c8 ff c3 66 0f 1f 44 00 00 31 f6 e9 09 00 00 00 66 0f 1f 84 00 00 00 00 00 b8 a6 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007ffff0dff428 EFLAGS: 00000246 ORIG_RAX: 00000000000000a6 RAX: 0000000000000000 RBX: 0000000000000000 RCX: 00007fcf3848d5d7 RDX: 00007ffff0dff4f9 RSI: 000000000000000a RDI: 00007ffff0dff4f0 RBP: 00007ffff0dff4f0 R08: 00000000ffffffff R09: 00007ffff0dff2c0 R10: 0000555557283773 R11: 0000000000000246 R12: 00007fcf384e6cdc R13: 00007ffff0e005b0 R14: 00005555572836f0 R15: 00007ffff0e005f0 Allocated by task 443: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4b/0x70 mm/kasan/common.c:52 kasan_save_alloc_info+0x1f/0x30 mm/kasan/generic.c:500 __kasan_slab_alloc+0x6c/0x80 mm/kasan/common.c:325 kasan_slab_alloc include/linux/kasan.h:201 [inline] slab_post_alloc_hook+0x53/0x2c0 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+0x102/0x220 mm/slub.c:3429 alloc_inode_sb include/linux/fs.h:3125 [inline] f2fs_alloc_inode+0x28/0x340 fs/f2fs/super.c:1378 alloc_inode fs/inode.c:259 [inline] iget_locked+0x169/0x6d0 fs/inode.c:1286 f2fs_iget+0x50/0x4700 fs/f2fs/inode.c:505 f2fs_lookup+0x28f/0xa10 fs/f2fs/namei.c:548 lookup_open fs/namei.c:3391 [inline] open_last_lookups fs/namei.c:3481 [inline] path_openat+0xe15/0x2450 fs/namei.c:3711 do_filp_open+0x226/0x430 fs/namei.c:3741 do_sys_openat2+0x10b/0x420 fs/open.c:1310 do_sys_open fs/open.c:1326 [inline] __do_sys_open fs/open.c:1334 [inline] __se_sys_open fs/open.c:1330 [inline] __x64_sys_open+0x1eb/0x240 fs/open.c:1330 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3d/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Freed by task 0: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4b/0x70 mm/kasan/common.c:52 kasan_save_free_info+0x2b/0x40 mm/kasan/generic.c:511 ____kasan_slab_free+0x131/0x180 mm/kasan/common.c:236 __kasan_slab_free+0x11/0x20 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+0x291/0x510 mm/slub.c:3683 f2fs_free_inode+0x1c/0x20 fs/f2fs/super.c:1523 i_callback+0x41/0x60 fs/inode.c:248 rcu_do_batch+0x515/0xb60 kernel/rcu/tree.c:2250 rcu_core+0x4eb/0xf10 kernel/rcu/tree.c:2510 rcu_core_si+0x9/0x10 kernel/rcu/tree.c:2527 __do_softirq+0x189/0x57c kernel/softirq.c:571 Last potentially related work creation: kasan_save_stack+0x3b/0x60 mm/kasan/common.c:45 __kasan_record_aux_stack+0xb4/0xc0 mm/kasan/generic.c:481 kasan_record_aux_stack_noalloc+0xb/0x10 mm/kasan/generic.c:491 call_rcu+0xec/0x1230 kernel/rcu/tree.c:2798 destroy_inode fs/inode.c:314 [inline] evict+0x564/0x5a0 fs/inode.c:679 dispose_list fs/inode.c:697 [inline] evict_inodes+0x51c/0x580 fs/inode.c:747 generic_shutdown_super+0x92/0x2a0 fs/super.c:480 kill_block_super+0x79/0xc0 fs/super.c:1428 kill_f2fs_super+0x252/0x320 fs/f2fs/super.c:4631 deactivate_locked_super+0x75/0xd0 fs/super.c:332 deactivate_super+0x5d/0x80 fs/super.c:363 cleanup_mnt+0x3d3/0x450 fs/namespace.c:1186 __cleanup_mnt+0xd/0x10 fs/namespace.c:1193 task_work_run+0x208/0x260 kernel/task_work.c:179 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline] exit_to_user_mode_loop+0x8b/0xa0 kernel/entry/common.c:171 exit_to_user_mode_prepare+0x5a/0xa0 kernel/entry/common.c:203 __syscall_exit_to_user_mode_work kernel/entry/common.c:285 [inline] syscall_exit_to_user_mode+0x26/0x130 kernel/entry/common.c:296 do_syscall_64+0x49/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x63/0xcd The buggy address belongs to the object at ffff888122e36ef8 which belongs to the cache f2fs_inode_cache of size 1208 The buggy address is located 136 bytes inside of 1208-byte region [ffff888122e36ef8, ffff888122e373b0) The buggy address belongs to the physical page: page:ffffea00048b8d00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x122e34 head:ffffea00048b8d00 order:2 compound_mapcount:0 compound_pincount:0 flags: 0x4000000000010200(slab|head|zone=1) raw: 4000000000010200 0000000000000000 dead000000000122 ffff88810a813500 raw: 0000000000000000 00000000800c000c 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 2, migratetype Reclaimable, gfp_mask 0x1d2050(__GFP_IO|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL|__GFP_RECLAIMABLE), pid 443, tgid 441 (syz-executor.0), ts 48580751700, free_ts 30732495497 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x1e2/0x1f0 mm/page_alloc.c:2532 prep_new_page mm/page_alloc.c:2539 [inline] get_page_from_freelist+0x2e7a/0x2f50 mm/page_alloc.c:4291 __alloc_pages+0x3c2/0x7d0 mm/page_alloc.c:5558 allocate_slab mm/slub.c:1939 [inline] new_slab+0xce/0x4c0 mm/slub.c:1992 ___slab_alloc+0x6f9/0xb80 mm/slub.c:3180 __slab_alloc+0x5d/0xa0 mm/slub.c:3279 slab_alloc_node mm/slub.c:3364 [inline] slab_alloc mm/slub.c:3406 [inline] __kmem_cache_alloc_lru mm/slub.c:3413 [inline] kmem_cache_alloc_lru+0x144/0x220 mm/slub.c:3429 alloc_inode_sb include/linux/fs.h:3125 [inline] f2fs_alloc_inode+0x28/0x340 fs/f2fs/super.c:1378 alloc_inode fs/inode.c:259 [inline] iget_locked+0x169/0x6d0 fs/inode.c:1286 f2fs_iget+0x50/0x4700 fs/f2fs/inode.c:505 f2fs_fill_super+0x4222/0x6d00 fs/f2fs/super.c:4250 mount_bdev+0x22c/0x330 fs/super.c:1401 f2fs_mount+0x10/0x20 fs/f2fs/super.c:4599 legacy_get_tree+0xe8/0x180 fs/fs_context.c:610 vfs_get_tree+0x87/0x250 fs/super.c:1531 do_new_mount+0x1e1/0x930 fs/namespace.c:3040 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1459 [inline] __free_pages_ok+0x886/0x890 mm/page_alloc.c:1715 free_the_page mm/page_alloc.c:772 [inline] free_compound_page+0xb0/0xd0 mm/page_alloc.c:793 free_transhuge_page+0x209/0x230 mm/huge_memory.c:2795 destroy_large_folio+0x56/0x90 mm/page_alloc.c:830 __folio_put_large mm/swap.c:118 [inline] release_pages+0x150/0xd60 mm/swap.c:1021 free_pages_and_swap_cache+0x68/0x80 mm/swap_state.c:314 tlb_batch_pages_flush mm/mmu_gather.c:59 [inline] tlb_flush_mmu_free mm/mmu_gather.c:254 [inline] tlb_flush_mmu mm/mmu_gather.c:261 [inline] tlb_finish_mmu+0x1ba/0x3b0 mm/mmu_gather.c:361 exit_mmap+0x291/0x5d0 mm/mmap.c:3096 __mmput+0x6b/0x2a0 kernel/fork.c:1185 mmput+0x24/0x30 kernel/fork.c:1207 exit_mm kernel/exit.c:516 [inline] do_exit+0x8f9/0x22b0 kernel/exit.c:807 do_group_exit+0x1ba/0x290 kernel/exit.c:950 get_signal+0x10ec/0x11f0 kernel/signal.c:2858 arch_do_signal_or_restart+0xb0/0x16f0 arch/x86/kernel/signal.c:869 exit_to_user_mode_loop+0x6b/0xa0 kernel/entry/common.c:168 exit_to_user_mode_prepare+0x5a/0xa0 kernel/entry/common.c:203 Memory state around the buggy address: ffff888122e36e80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fa ffff888122e36f00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888122e36f80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888122e37000: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888122e37080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================