do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:152 el0_svc+0x54/0x168 arch/arm64/kernel/entry-common.c:712 el0t_64_sync_handler+0x84/0xfc arch/arm64/kernel/entry-common.c:730 el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:598 ================================================================== BUG: KASAN: slab-use-after-free in sanity_check_extent_cache+0x300/0x390 fs/f2fs/extent_cache.c:46 Read of size 4 at addr ffff0000da335150 by task syz-executor.1/6103 CPU: 0 PID: 6103 Comm: syz-executor.1 Not tainted 6.9.0-rc6-syzkaller-00234-g7367539ad4b0 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 03/27/2024 Call trace: dump_backtrace+0x1b8/0x1e4 arch/arm64/kernel/stacktrace.c:317 show_stack+0x2c/0x3c arch/arm64/kernel/stacktrace.c:324 __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xe4/0x150 lib/dump_stack.c:114 print_address_description mm/kasan/report.c:377 [inline] print_report+0x178/0x518 mm/kasan/report.c:488 kasan_report+0xd8/0x138 mm/kasan/report.c:601 __asan_report_load4_noabort+0x20/0x2c mm/kasan/report_generic.c:380 sanity_check_extent_cache+0x300/0x390 fs/f2fs/extent_cache.c:46 do_read_inode fs/f2fs/inode.c:509 [inline] f2fs_iget+0x2d50/0x45e0 fs/f2fs/inode.c:560 f2fs_nfs_get_inode+0x80/0x118 fs/f2fs/super.c:3237 generic_fh_to_dentry+0x9c/0x104 fs/libfs.c:1413 f2fs_fh_to_dentry+0x44/0x58 fs/f2fs/super.c:3251 exportfs_decode_fh_raw+0x128/0x4ac fs/exportfs/expfs.c:444 exportfs_decode_fh+0x50/0x80 fs/exportfs/expfs.c:584 do_handle_to_path fs/fhandle.c:155 [inline] handle_to_path fs/fhandle.c:210 [inline] do_handle_open+0x534/0x718 fs/fhandle.c:226 __do_sys_open_by_handle_at fs/fhandle.c:267 [inline] __se_sys_open_by_handle_at fs/fhandle.c:258 [inline] __arm64_sys_open_by_handle_at+0x80/0x94 fs/fhandle.c:258 __invoke_syscall arch/arm64/kernel/syscall.c:34 [inline] invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:48 el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:133 do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:152 el0_svc+0x54/0x168 arch/arm64/kernel/entry-common.c:712 el0t_64_sync_handler+0x84/0xfc arch/arm64/kernel/entry-common.c:730 el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:598 Allocated by task 6065: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x40/0x78 mm/kasan/common.c:68 kasan_save_alloc_info+0x40/0x50 mm/kasan/generic.c:565 unpoison_slab_object mm/kasan/common.c:312 [inline] __kasan_slab_alloc+0x58/0x70 mm/kasan/common.c:338 kasan_slab_alloc include/linux/kasan.h:201 [inline] slab_post_alloc_hook mm/slub.c:3798 [inline] slab_alloc_node mm/slub.c:3845 [inline] kmem_cache_alloc+0x1dc/0x390 mm/slub.c:3852 f2fs_kmem_cache_alloc_nofail fs/f2fs/f2fs.h:2817 [inline] f2fs_kmem_cache_alloc fs/f2fs/f2fs.h:2827 [inline] __grab_extent_tree+0x188/0x40c fs/f2fs/extent_cache.c:334 f2fs_init_read_extent_tree+0x3b0/0x858 fs/f2fs/extent_cache.c:405 do_read_inode fs/f2fs/inode.c:506 [inline] f2fs_iget+0x2d40/0x45e0 fs/f2fs/inode.c:560 f2fs_nfs_get_inode+0x80/0x118 fs/f2fs/super.c:3237 generic_fh_to_dentry+0x9c/0x104 fs/libfs.c:1413 f2fs_fh_to_dentry+0x44/0x58 fs/f2fs/super.c:3251 exportfs_decode_fh_raw+0x128/0x4ac fs/exportfs/expfs.c:444 exportfs_decode_fh+0x50/0x80 fs/exportfs/expfs.c:584 do_handle_to_path fs/fhandle.c:155 [inline] handle_to_path fs/fhandle.c:210 [inline] do_handle_open+0x534/0x718 fs/fhandle.c:226 __do_sys_open_by_handle_at fs/fhandle.c:267 [inline] __se_sys_open_by_handle_at fs/fhandle.c:258 [inline] __arm64_sys_open_by_handle_at+0x80/0x94 fs/fhandle.c:258 __invoke_syscall arch/arm64/kernel/syscall.c:34 [inline] invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:48 el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:133 do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:152 el0_svc+0x54/0x168 arch/arm64/kernel/entry-common.c:712 el0t_64_sync_handler+0x84/0xfc arch/arm64/kernel/entry-common.c:730 el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:598 Freed by task 6065: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x40/0x78 mm/kasan/common.c:68 kasan_save_free_info+0x54/0x6c mm/kasan/generic.c:579 poison_slab_object+0x124/0x18c mm/kasan/common.c:240 __kasan_slab_free+0x1c/0x48 mm/kasan/common.c:256 kasan_slab_free include/linux/kasan.h:184 [inline] slab_free_hook mm/slub.c:2106 [inline] slab_free mm/slub.c:4280 [inline] kmem_cache_free+0x150/0x3cc mm/slub.c:4344 __destroy_extent_tree+0x318/0x740 fs/f2fs/extent_cache.c:1132 f2fs_destroy_extent_tree+0x24/0x40 fs/f2fs/extent_cache.c:1143 f2fs_evict_inode+0x3d8/0x1530 fs/f2fs/inode.c:831 evict+0x260/0x68c fs/inode.c:667 iput_final fs/inode.c:1741 [inline] iput+0x760/0x844 fs/inode.c:1767 iget_failed+0xec/0x134 fs/bad_inode.c:248 f2fs_iget+0x1858/0x45e0 fs/f2fs/inode.c:621 f2fs_nfs_get_inode+0x80/0x118 fs/f2fs/super.c:3237 generic_fh_to_dentry+0x9c/0x104 fs/libfs.c:1413 f2fs_fh_to_dentry+0x44/0x58 fs/f2fs/super.c:3251 exportfs_decode_fh_raw+0x128/0x4ac fs/exportfs/expfs.c:444 exportfs_decode_fh+0x50/0x80 fs/exportfs/expfs.c:584 do_handle_to_path fs/fhandle.c:155 [inline] handle_to_path fs/fhandle.c:210 [inline] do_handle_open+0x534/0x718 fs/fhandle.c:226 __do_sys_open_by_handle_at fs/fhandle.c:267 [inline] __se_sys_open_by_handle_at fs/fhandle.c:258 [inline] __arm64_sys_open_by_handle_at+0x80/0x94 fs/fhandle.c:258 __invoke_syscall arch/arm64/kernel/syscall.c:34 [inline] invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:48 el0_svc_common+0x130/0x23c arch/arm64/kernel/syscall.c:133 do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:152 el0_svc+0x54/0x168 arch/arm64/kernel/entry-common.c:712 el0t_64_sync_handler+0x84/0xfc arch/arm64/kernel/entry-common.c:730 el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:598 The buggy address belongs to the object at ffff0000da3350d0 which belongs to the cache f2fs_extent_tree of size 144 The buggy address is located 128 bytes inside of freed 144-byte region [ffff0000da3350d0, ffff0000da335160) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x11a335 flags: 0x5ffc00000000800(slab|node=0|zone=2|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 05ffc00000000800 ffff0000c4a3fa00 dead000000000122 0000000000000000 raw: 0000000000000000 0000000080130013 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff0000da335000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff0000da335080: fb fb fc fc fc fc fc fc fc fc fa fb fb fb fb fb >ffff0000da335100: fb fb fb fb fb fb fb fb fb fb fb fb fc fc fc fc ^ ffff0000da335180: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff0000da335200: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ================================================================== F2FS-fs (loop1): sanity_check_extent_cache: inode (ino=8) extent info [5634, 0, 3] is incorrect, run fsck to fix