R10: 0000555556b42773 R11: 0000000000000246 R12: 00007f5d8d0e6cdc R13: 00007ffd06971f10 R14: 0000555556b426f0 R15: 00007ffd06971f50 ---[ end trace 0000000000000000 ]--- ================================================================== BUG: KASAN: slab-use-after-free in instrument_atomic_read_write include/linux/instrumented.h:96 [inline] BUG: KASAN: slab-use-after-free in atomic_try_cmpxchg_acquire include/linux/atomic/atomic-instrumented.h:541 [inline] BUG: KASAN: slab-use-after-free in queued_spin_lock include/asm-generic/qspinlock.h:111 [inline] BUG: KASAN: slab-use-after-free in do_raw_spin_lock include/linux/spinlock.h:186 [inline] BUG: KASAN: slab-use-after-free in __raw_spin_lock include/linux/spinlock_api_smp.h:134 [inline] BUG: KASAN: slab-use-after-free in _raw_spin_lock+0x97/0x1b0 kernel/locking/spinlock.c:154 Write of size 4 at addr ffff8881246ae4a0 by task syz-executor.0/339 CPU: 0 PID: 339 Comm: syz-executor.0 Tainted: G W 6.4.0-rc5-syzkaller-ga4d7d7011219 #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+0x151/0x1c0 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:351 [inline] print_report+0x15d/0x540 mm/kasan/report.c:462 kasan_report+0x17c/0x1b0 mm/kasan/report.c:572 kasan_check_range+0x294/0x2a0 mm/kasan/generic.c:187 __kasan_check_write+0x14/0x20 mm/kasan/shadow.c:37 instrument_atomic_read_write include/linux/instrumented.h:96 [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+0x20/0xa0 fs/inode.c:1388 f2fs_sync_inode_meta fs/f2fs/checkpoint.c:1151 [inline] block_operations fs/f2fs/checkpoint.c:1259 [inline] f2fs_write_checkpoint+0xda5/0x2410 fs/f2fs/checkpoint.c:1651 f2fs_issue_checkpoint+0x2e5/0x4f0 fs/f2fs/checkpoint.c:1858 f2fs_sync_fs+0x186/0x2f0 fs/f2fs/super.c:1669 sync_filesystem+0x1cf/0x250 fs/sync.c:66 f2fs_quota_off_umount+0x20e/0x220 fs/f2fs/super.c:2944 f2fs_put_super+0xbe/0xca0 fs/f2fs/super.c:1558 generic_shutdown_super+0x14f/0x370 fs/super.c:500 kill_block_super+0x7e/0xe0 fs/super.c:1407 kill_f2fs_super+0x2f9/0x3c0 fs/f2fs/super.c:4702 deactivate_locked_super+0xa5/0x110 fs/super.c:331 deactivate_super+0xbe/0xf0 fs/super.c:362 cleanup_mnt+0x432/0x4d0 fs/namespace.c:1177 __cleanup_mnt+0x19/0x20 fs/namespace.c:1184 task_work_run+0x24d/0x2e0 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:204 __syscall_exit_to_user_mode_work kernel/entry/common.c:286 [inline] syscall_exit_to_user_mode+0x26/0x130 kernel/entry/common.c:297 do_syscall_64+0x49/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7f5d8d08d5d7 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:00007ffd06970d88 EFLAGS: 00000246 ORIG_RAX: 00000000000000a6 RAX: 0000000000000000 RBX: 0000000000000000 RCX: 00007f5d8d08d5d7 RDX: 00007ffd06970e59 RSI: 000000000000000a RDI: 00007ffd06970e50 RBP: 00007ffd06970e50 R08: 00000000ffffffff R09: 00007ffd06970c20 R10: 0000555556b42773 R11: 0000000000000246 R12: 00007f5d8d0e6cdc R13: 00007ffd06971f10 R14: 0000555556b426f0 R15: 00007ffd06971f50 Allocated by task 345: 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:510 __kasan_slab_alloc+0x69/0x80 mm/kasan/common.c:328 kasan_slab_alloc include/linux/kasan.h:186 [inline] slab_post_alloc_hook+0x66/0x320 mm/slab.h:711 slab_alloc_node mm/slub.c:3451 [inline] slab_alloc mm/slub.c:3459 [inline] __kmem_cache_alloc_lru mm/slub.c:3466 [inline] kmem_cache_alloc_lru+0x121/0x2a0 mm/slub.c:3482 alloc_inode_sb include/linux/fs.h:2705 [inline] f2fs_alloc_inode+0x2d/0x350 fs/f2fs/super.c:1383 alloc_inode fs/inode.c:260 [inline] iget_locked+0x18c/0x7e0 fs/inode.c:1286 f2fs_iget+0x55/0x4df0 fs/f2fs/inode.c:503 f2fs_lookup+0x410/0xd80 fs/f2fs/namei.c:541 lookup_open fs/namei.c:3470 [inline] open_last_lookups fs/namei.c:3560 [inline] path_openat+0x124a/0x30b0 fs/namei.c:3788 do_filp_open+0x230/0x480 fs/namei.c:3818 do_sys_openat2+0x13b/0x500 fs/open.c:1356 do_sys_open fs/open.c:1372 [inline] __do_sys_open fs/open.c:1380 [inline] __se_sys_open fs/open.c:1376 [inline] __x64_sys_open+0x221/0x270 fs/open.c:1376 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:521 ____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:162 [inline] slab_free_hook mm/slub.c:1781 [inline] slab_free_freelist_hook mm/slub.c:1807 [inline] slab_free mm/slub.c:3786 [inline] kmem_cache_free+0x291/0x510 mm/slub.c:3808 f2fs_free_inode+0x24/0x30 fs/f2fs/super.c:1526 i_callback+0x4b/0x70 fs/inode.c:249 rcu_do_batch+0x4b4/0xb80 kernel/rcu/tree.c:2115 rcu_core+0x4e8/0xef0 kernel/rcu/tree.c:2377 rcu_core_si+0x9/0x10 kernel/rcu/tree.c:2394 __do_softirq+0x18f/0x570 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:491 kasan_record_aux_stack_noalloc+0xb/0x10 mm/kasan/generic.c:501 __call_rcu_common kernel/rcu/tree.c:2627 [inline] call_rcu+0xee/0x1340 kernel/rcu/tree.c:2741 destroy_inode fs/inode.c:315 [inline] evict+0x5df/0x630 fs/inode.c:680 dispose_list fs/inode.c:698 [inline] evict_inodes+0x5be/0x640 fs/inode.c:748 generic_shutdown_super+0x97/0x370 fs/super.c:479 kill_block_super+0x7e/0xe0 fs/super.c:1407 kill_f2fs_super+0x2f9/0x3c0 fs/f2fs/super.c:4702 deactivate_locked_super+0xa5/0x110 fs/super.c:331 deactivate_super+0xbe/0xf0 fs/super.c:362 cleanup_mnt+0x432/0x4d0 fs/namespace.c:1177 __cleanup_mnt+0x19/0x20 fs/namespace.c:1184 task_work_run+0x24d/0x2e0 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:204 __syscall_exit_to_user_mode_work kernel/entry/common.c:286 [inline] syscall_exit_to_user_mode+0x26/0x130 kernel/entry/common.c:297 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 ffff8881246ae418 which belongs to the cache f2fs_inode_cache of size 1192 The buggy address is located 136 bytes inside of freed 1192-byte region [ffff8881246ae418, ffff8881246ae8c0) The buggy address belongs to the physical page: page:ffffea000491ab00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1246ac head:ffffea000491ab00 order:2 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0x4000000000010200(slab|head|zone=1) page_type: 0xffffffff() raw: 4000000000010200 ffff88810a6b63c0 dead000000000122 0000000000000000 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 345, tgid 343 (syz-executor.0), ts 39811657646, free_ts 0 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x213/0x220 mm/page_alloc.c:1731 prep_new_page mm/page_alloc.c:1738 [inline] get_page_from_freelist+0x340e/0x34e0 mm/page_alloc.c:3502 __alloc_pages+0x3c2/0x7d0 mm/page_alloc.c:4768 allocate_slab mm/slub.c:1998 [inline] new_slab+0xce/0x4c0 mm/slub.c:2051 ___slab_alloc+0x6f9/0xb80 mm/slub.c:3192 __slab_alloc mm/slub.c:3291 [inline] __slab_alloc_node mm/slub.c:3344 [inline] slab_alloc_node mm/slub.c:3441 [inline] slab_alloc mm/slub.c:3459 [inline] __kmem_cache_alloc_lru mm/slub.c:3466 [inline] kmem_cache_alloc_lru+0x190/0x2a0 mm/slub.c:3482 alloc_inode_sb include/linux/fs.h:2705 [inline] f2fs_alloc_inode+0x2d/0x350 fs/f2fs/super.c:1383 alloc_inode fs/inode.c:260 [inline] iget_locked+0x18c/0x7e0 fs/inode.c:1286 f2fs_iget+0x55/0x4df0 fs/f2fs/inode.c:503 f2fs_fill_super+0x3d9a/0x6dd0 fs/f2fs/super.c:4315 mount_bdev+0x27c/0x3a0 fs/super.c:1380 f2fs_mount+0x34/0x40 fs/f2fs/super.c:4670 legacy_get_tree+0xee/0x190 fs/fs_context.c:610 vfs_get_tree+0x88/0x290 fs/super.c:1510 do_new_mount+0x28b/0xad0 fs/namespace.c:3039 path_mount+0x673/0x1000 fs/namespace.c:3369 page_owner free stack trace missing Memory state around the buggy address: ffff8881246ae380: fb fb fb fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8881246ae400: fc fc fc fa fb fb fb fb fb fb fb fb fb fb fb fb >ffff8881246ae480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8881246ae500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8881246ae580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================