================================================================== 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 ffff0000dbeed080 by task syz-executor.0/6733 CPU: 1 PID: 6733 Comm: syz-executor.0 Tainted: G W 6.10.0-rc2-syzkaller-00003-g8867bbd4a056 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 04/02/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+0x198/0x538 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:515 [inline] f2fs_iget+0x2e30/0x46c4 fs/f2fs/inode.c:566 f2fs_nfs_get_inode+0x80/0x118 fs/f2fs/super.c:3265 generic_fh_to_dentry+0x9c/0x104 fs/libfs.c:1456 f2fs_fh_to_dentry+0x44/0x58 fs/f2fs/super.c:3279 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 6700: 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+0x74/0x8c mm/kasan/common.c:338 kasan_slab_alloc include/linux/kasan.h:201 [inline] slab_post_alloc_hook mm/slub.c:3940 [inline] slab_alloc_node mm/slub.c:4000 [inline] kmem_cache_alloc_noprof+0x1c0/0x350 mm/slub.c:4007 f2fs_kmem_cache_alloc_nofail fs/f2fs/f2fs.h:2815 [inline] f2fs_kmem_cache_alloc fs/f2fs/f2fs.h:2825 [inline] __grab_extent_tree+0x188/0x40c fs/f2fs/extent_cache.c:334 f2fs_init_read_extent_tree+0x3b4/0x85c fs/f2fs/extent_cache.c:405 do_read_inode fs/f2fs/inode.c:512 [inline] f2fs_iget+0x2e20/0x46c4 fs/f2fs/inode.c:566 f2fs_nfs_get_inode+0x80/0x118 fs/f2fs/super.c:3265 generic_fh_to_dentry+0x9c/0x104 fs/libfs.c:1456 f2fs_fh_to_dentry+0x44/0x58 fs/f2fs/super.c:3279 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 6700: 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+0x128/0x180 mm/kasan/common.c:240 __kasan_slab_free+0x3c/0x70 mm/kasan/common.c:256 kasan_slab_free include/linux/kasan.h:184 [inline] slab_free_hook mm/slub.c:2195 [inline] slab_free mm/slub.c:4436 [inline] kmem_cache_free+0x178/0x4e4 mm/slub.c:4511 __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/0x14f4 fs/f2fs/inode.c:837 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+0x185c/0x46c4 fs/f2fs/inode.c:627 f2fs_nfs_get_inode+0x80/0x118 fs/f2fs/super.c:3265 generic_fh_to_dentry+0x9c/0x104 fs/libfs.c:1456 f2fs_fh_to_dentry+0x44/0x58 fs/f2fs/super.c:3279 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 ffff0000dbeed000 which belongs to the cache f2fs_extent_tree of size 144 The buggy address is located 128 bytes inside of freed 144-byte region [ffff0000dbeed000, ffff0000dbeed090) The buggy address belongs to the physical page: page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x11beed flags: 0x5ffc00000000000(node=0|zone=2|lastcpupid=0x7ff) page_type: 0xffffefff(slab) raw: 05ffc00000000000 ffff0000c4f28640 dead000000000122 0000000000000000 raw: 0000000000000000 0000000080130013 00000001ffffefff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff0000dbeecf80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff0000dbeed000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff0000dbeed080: fb fb fc fc fc fc fc fc fc fc 00 00 00 00 00 00 ^ ffff0000dbeed100: 00 00 00 00 00 00 00 00 00 00 00 00 fc fc fc fc ffff0000dbeed180: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ================================================================== F2FS-fs (loop0): sanity_check_extent_cache: inode (ino=8) extent info [5634, 0, 3] is incorrect, run fsck to fix