RBP: 00007f7ec9c13f91 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007f7ec9de6218 R14: 00007f7ec9de6180 R15: 00007ffc33e87cb8 ================================================================== BUG: KASAN: use-after-free in sanity_check_extent_cache+0x26b/0x320 fs/f2fs/extent_cache.c:35 Read of size 4 at addr ffff88804e5e8148 by task syz.5.274/6017 CPU: 1 PID: 6017 Comm: syz.5.274 Not tainted syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/25/2025 Call Trace: dump_stack_lvl+0x168/0x22e lib/dump_stack.c:106 print_address_description mm/kasan/report.c:316 [inline] print_report+0xa8/0x210 mm/kasan/report.c:420 kasan_report+0x10b/0x140 mm/kasan/report.c:524 sanity_check_extent_cache+0x26b/0x320 fs/f2fs/extent_cache.c:35 do_read_inode fs/f2fs/inode.c:461 [inline] f2fs_iget+0x36e9/0x4b30 fs/f2fs/inode.c:512 f2fs_nfs_get_inode+0x72/0x100 fs/f2fs/super.c:3157 generic_fh_to_dentry+0x8f/0xe0 fs/libfs.c:1072 exportfs_decode_fh_raw+0x12a/0x640 fs/exportfs/expfs.c:435 exportfs_decode_fh+0x36/0x70 fs/exportfs/expfs.c:575 do_handle_to_path fs/fhandle.c:152 [inline] handle_to_path fs/fhandle.c:207 [inline] do_handle_open+0x3df/0x810 fs/fhandle.c:223 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 RIP: 0033:0x7f7ec9b8f749 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f7ecaa01038 EFLAGS: 00000246 ORIG_RAX: 0000000000000130 RAX: ffffffffffffffda RBX: 00007f7ec9de6180 RCX: 00007f7ec9b8f749 RDX: 0000000002000000 RSI: 00002000000000c0 RDI: ffffffffffffff9c RBP: 00007f7ec9c13f91 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007f7ec9de6218 R14: 00007f7ec9de6180 R15: 00007ffc33e87cb8 Allocated by task 6015: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4b/0x70 mm/kasan/common.c:52 __kasan_slab_alloc+0x6b/0x80 mm/kasan/common.c:328 kasan_slab_alloc include/linux/kasan.h:201 [inline] slab_post_alloc_hook+0x4b/0x480 mm/slab.h:737 slab_alloc_node mm/slub.c:3359 [inline] slab_alloc mm/slub.c:3367 [inline] __kmem_cache_alloc_lru mm/slub.c:3374 [inline] kmem_cache_alloc+0x123/0x2f0 mm/slub.c:3383 f2fs_kmem_cache_alloc_nofail fs/f2fs/f2fs.h:2786 [inline] f2fs_kmem_cache_alloc fs/f2fs/f2fs.h:2796 [inline] __grab_extent_tree+0x19b/0x3d0 fs/f2fs/extent_cache.c:384 f2fs_init_read_extent_tree+0x29e/0x7c0 fs/f2fs/extent_cache.c:455 do_read_inode fs/f2fs/inode.c:459 [inline] f2fs_iget+0x36e1/0x4b30 fs/f2fs/inode.c:512 f2fs_nfs_get_inode+0x72/0x100 fs/f2fs/super.c:3157 generic_fh_to_dentry+0x8f/0xe0 fs/libfs.c:1072 exportfs_decode_fh_raw+0x12a/0x640 fs/exportfs/expfs.c:435 exportfs_decode_fh+0x36/0x70 fs/exportfs/expfs.c:575 do_handle_to_path fs/fhandle.c:152 [inline] handle_to_path fs/fhandle.c:207 [inline] do_handle_open+0x3df/0x810 fs/fhandle.c:223 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 Freed by task 6015: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4b/0x70 mm/kasan/common.c:52 kasan_save_free_info+0x2d/0x50 mm/kasan/generic.c:516 ____kasan_slab_free+0x126/0x1e0 mm/kasan/common.c:236 kasan_slab_free include/linux/kasan.h:177 [inline] slab_free_hook mm/slub.c:1729 [inline] slab_free_freelist_hook+0x131/0x1a0 mm/slub.c:1755 slab_free mm/slub.c:3687 [inline] kmem_cache_free+0xf7/0x290 mm/slub.c:3709 __destroy_extent_tree fs/f2fs/extent_cache.c:1011 [inline] f2fs_destroy_extent_tree+0x2c3/0x5f0 fs/f2fs/extent_cache.c:1022 f2fs_evict_inode+0x460/0x17d0 fs/f2fs/inode.c:781 evict+0x485/0x870 fs/inode.c:705 f2fs_iget+0x1888/0x4b30 fs/f2fs/inode.c:565 f2fs_nfs_get_inode+0x72/0x100 fs/f2fs/super.c:3157 generic_fh_to_dentry+0x8f/0xe0 fs/libfs.c:1072 exportfs_decode_fh_raw+0x12a/0x640 fs/exportfs/expfs.c:435 exportfs_decode_fh+0x36/0x70 fs/exportfs/expfs.c:575 do_handle_to_path fs/fhandle.c:152 [inline] handle_to_path fs/fhandle.c:207 [inline] do_handle_open+0x3df/0x810 fs/fhandle.c:223 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 The buggy address belongs to the object at ffff88804e5e80c8 which belongs to the cache f2fs_extent_tree of size 136 The buggy address is located 128 bytes inside of 136-byte region [ffff88804e5e80c8, ffff88804e5e8150) The buggy address belongs to the physical page: page:ffffea0001397a00 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff88804e5e8000 pfn:0x4e5e8 flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000200 0000000000000000 dead000000000122 ffff88801c7a1c80 raw: ffff88804e5e8000 0000000080140013 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Reclaimable, gfp_mask 0x112c50(GFP_NOFS|__GFP_NOWARN|__GFP_NORETRY|__GFP_HARDWALL|__GFP_RECLAIMABLE), pid 5234, tgid 5231 (syz.3.152), ts 136043638267, free_ts 123541287052 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x173/0x1a0 mm/page_alloc.c:2532 prep_new_page mm/page_alloc.c:2539 [inline] get_page_from_freelist+0x1a26/0x1ac0 mm/page_alloc.c:4328 __alloc_pages+0x1df/0x4e0 mm/page_alloc.c:5614 alloc_slab_page+0x5d/0x160 mm/slub.c:1799 allocate_slab mm/slub.c:1944 [inline] new_slab+0x87/0x2c0 mm/slub.c:1997 ___slab_alloc+0xbc6/0x1230 mm/slub.c:3154 __slab_alloc mm/slub.c:3240 [inline] slab_alloc_node mm/slub.c:3325 [inline] slab_alloc mm/slub.c:3367 [inline] __kmem_cache_alloc_lru mm/slub.c:3374 [inline] kmem_cache_alloc+0x1b7/0x2f0 mm/slub.c:3383 f2fs_kmem_cache_alloc_nofail fs/f2fs/f2fs.h:2786 [inline] f2fs_kmem_cache_alloc fs/f2fs/f2fs.h:2796 [inline] __grab_extent_tree+0x19b/0x3d0 fs/f2fs/extent_cache.c:384 f2fs_new_inode+0xdd6/0x1040 fs/f2fs/namei.c:283 f2fs_create+0x188/0x9e0 fs/f2fs/namei.c:354 lookup_open fs/namei.c:3490 [inline] open_last_lookups fs/namei.c:3558 [inline] path_openat+0x1187/0x2e70 fs/namei.c:3788 do_filp_open+0x1c1/0x3c0 fs/namei.c:3818 do_sys_openat2+0x142/0x490 fs/open.c:1320 do_sys_open fs/open.c:1336 [inline] __do_sys_open fs/open.c:1344 [inline] __se_sys_open fs/open.c:1340 [inline] __x64_sys_open+0x11b/0x140 fs/open.c:1340 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 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_pcp_prepare mm/page_alloc.c:1509 [inline] free_unref_page_prepare+0x8b4/0x9a0 mm/page_alloc.c:3384 free_unref_page+0x2e/0x3f0 mm/page_alloc.c:3479 free_slab mm/slub.c:2036 [inline] discard_slab mm/slub.c:2042 [inline] __unfreeze_partials+0x1a5/0x200 mm/slub.c:2591 put_cpu_partial+0x17c/0x250 mm/slub.c:2667 qlink_free mm/kasan/quarantine.c:168 [inline] qlist_free_all+0x76/0xe0 mm/kasan/quarantine.c:187 kasan_quarantine_reduce+0x144/0x160 mm/kasan/quarantine.c:294 __kasan_slab_alloc+0x1e/0x80 mm/kasan/common.c:305 kasan_slab_alloc include/linux/kasan.h:201 [inline] slab_post_alloc_hook+0x4b/0x480 mm/slab.h:737 slab_alloc_node mm/slub.c:3359 [inline] slab_alloc mm/slub.c:3367 [inline] __kmem_cache_alloc_lru mm/slub.c:3374 [inline] kmem_cache_alloc+0x123/0x2f0 mm/slub.c:3383 anon_vma_alloc mm/rmap.c:93 [inline] anon_vma_fork+0xda/0x4f0 mm/rmap.c:359 dup_mmap kernel/fork.c:663 [inline] dup_mm kernel/fork.c:1541 [inline] copy_mm+0xb44/0x15c0 kernel/fork.c:1590 copy_process+0x1953/0x4020 kernel/fork.c:2351 kernel_clone+0x225/0x8b0 kernel/fork.c:2757 __do_sys_clone kernel/fork.c:2898 [inline] __se_sys_clone kernel/fork.c:2882 [inline] __x64_sys_clone+0x17c/0x1d0 kernel/fork.c:2882 do_syscall_x64 arch/x86/entry/common.c:51 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:81 entry_SYSCALL_64_after_hwframe+0x68/0xd2 Memory state around the buggy address: ffff88804e5e8000: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88804e5e8080: fb fc fc fc fc fc fc fc fc fa fb fb fb fb fb fb >ffff88804e5e8100: fb fb fb fb fb fb fb fb fb fb fc fc fc fc fc fc ^ ffff88804e5e8180: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88804e5e8200: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================