R10: 0000000000000001 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000001 R14: 00007f02235c6080 R15: 00007fffae4d6c58 ================================================================== BUG: KASAN: use-after-free in sanity_check_extent_cache+0x407/0x4b0 fs/f2fs/extent_cache.c:49 Read of size 4 at addr ffff888117bb6138 by task syz.4.20/509 CPU: 0 PID: 509 Comm: syz.4.20 Not tainted syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/07/2026 Call Trace: __dump_stack+0x21/0x24 lib/dump_stack.c:88 dump_stack_lvl+0x110/0x170 lib/dump_stack.c:106 print_address_description+0x71/0x200 mm/kasan/report.c:316 print_report+0x4a/0x60 mm/kasan/report.c:420 kasan_report+0x122/0x150 mm/kasan/report.c:524 __asan_report_load4_noabort+0x14/0x20 mm/kasan/report_generic.c:350 sanity_check_extent_cache+0x407/0x4b0 fs/f2fs/extent_cache.c:49 do_read_inode fs/f2fs/inode.c:464 [inline] f2fs_iget+0x371d/0x5200 fs/f2fs/inode.c:520 f2fs_lookup+0x3a9/0xab0 fs/f2fs/namei.c:486 lookup_open fs/namei.c:3467 [inline] open_last_lookups fs/namei.c:3557 [inline] path_openat+0x13fe/0x2f30 fs/namei.c:3787 do_filp_open+0x1ee/0x420 fs/namei.c:3817 do_sys_openat2+0x15e/0x820 fs/open.c:1343 do_sys_open fs/open.c:1359 [inline] __do_sys_openat fs/open.c:1375 [inline] __se_sys_openat fs/open.c:1370 [inline] __x64_sys_openat+0x136/0x160 fs/open.c:1370 x64_sys_call+0x783/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:258 do_syscall_x64 arch/x86/entry/common.c:46 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:76 entry_SYSCALL_64_after_hwframe+0x68/0xd2 RIP: 0033:0x7f0223399079 Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 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 e8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f02242a2028 EFLAGS: 00000246 ORIG_RAX: 0000000000000101 RAX: ffffffffffffffda RBX: 00007f02235c6080 RCX: 00007f0223399079 RDX: 0000000000101000 RSI: 0000200000000080 RDI: ffffffffffffff9c RBP: 00007f022342ba4c R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000001 R11: 0000000000000246 R12: 0000000000000000 R13: 0000000000000001 R14: 00007f02235c6080 R15: 00007fffae4d6c58 Allocated by task 494: kasan_save_stack mm/kasan/common.c:46 [inline] kasan_set_track+0x4b/0x70 mm/kasan/common.c:53 kasan_save_alloc_info+0x1f/0x30 mm/kasan/generic.c:505 __kasan_slab_alloc+0x72/0x80 mm/kasan/common.c:334 kasan_slab_alloc include/linux/kasan.h:202 [inline] slab_post_alloc_hook+0x4f/0x2d0 mm/slab.h:768 slab_alloc_node mm/slub.c:3382 [inline] slab_alloc mm/slub.c:3392 [inline] __kmem_cache_alloc_lru mm/slub.c:3399 [inline] kmem_cache_alloc+0x166/0x320 mm/slub.c:3408 f2fs_kmem_cache_alloc fs/f2fs/f2fs.h:-1 [inline] __grab_extent_tree+0x19a/0x420 fs/f2fs/extent_cache.c:335 f2fs_init_read_extent_tree+0x3e6/0x7e0 fs/f2fs/extent_cache.c:406 do_read_inode fs/f2fs/inode.c:461 [inline] f2fs_iget+0x370d/0x5200 fs/f2fs/inode.c:520 f2fs_lookup+0x3a9/0xab0 fs/f2fs/namei.c:486 __lookup_slow+0x2d5/0x410 fs/namei.c:1697 lookup_slow+0x57/0x70 fs/namei.c:1714 walk_component+0x2f5/0x430 fs/namei.c:2005 lookup_last fs/namei.c:2462 [inline] path_lookupat+0x155/0x430 fs/namei.c:2486 filename_lookup+0x229/0x580 fs/namei.c:2515 user_path_at_empty+0x46/0x1c0 fs/namei.c:2912 user_path_at include/linux/namei.h:57 [inline] do_sys_truncate+0xb6/0x1c0 fs/open.c:133 __do_sys_truncate fs/open.c:147 [inline] __se_sys_truncate fs/open.c:145 [inline] __x64_sys_truncate+0x5b/0x70 fs/open.c:145 x64_sys_call+0x679/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:77 do_syscall_x64 arch/x86/entry/common.c:46 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:76 entry_SYSCALL_64_after_hwframe+0x68/0xd2 Freed by task 494: kasan_save_stack mm/kasan/common.c:46 [inline] kasan_set_track+0x4b/0x70 mm/kasan/common.c:53 kasan_save_free_info+0x2b/0x40 mm/kasan/generic.c:516 ____kasan_slab_free+0x132/0x180 mm/kasan/common.c:242 __kasan_slab_free+0x11/0x20 mm/kasan/common.c:250 kasan_slab_free include/linux/kasan.h:178 [inline] slab_free_hook mm/slub.c:1750 [inline] slab_free_freelist_hook+0xc2/0x190 mm/slub.c:1776 slab_free mm/slub.c:3712 [inline] kmem_cache_free+0x12d/0x300 mm/slub.c:3737 __destroy_extent_tree+0x305/0x530 fs/f2fs/extent_cache.c:1135 f2fs_destroy_extent_tree+0x17/0x30 fs/f2fs/extent_cache.c:1146 f2fs_evict_inode+0x6dd/0x1850 fs/f2fs/inode.c:808 evict+0x4c4/0x8c0 fs/inode.c:709 iput_final fs/inode.c:1845 [inline] iput+0x633/0x690 fs/inode.c:1871 iget_failed+0x162/0x1a0 fs/bad_inode.c:250 f2fs_iget+0x1d79/0x5200 fs/f2fs/inode.c:573 f2fs_lookup+0x3a9/0xab0 fs/f2fs/namei.c:486 __lookup_slow+0x2d5/0x410 fs/namei.c:1697 lookup_slow+0x57/0x70 fs/namei.c:1714 walk_component+0x2f5/0x430 fs/namei.c:2005 lookup_last fs/namei.c:2462 [inline] path_lookupat+0x155/0x430 fs/namei.c:2486 filename_lookup+0x229/0x580 fs/namei.c:2515 user_path_at_empty+0x46/0x1c0 fs/namei.c:2912 user_path_at include/linux/namei.h:57 [inline] do_sys_truncate+0xb6/0x1c0 fs/open.c:133 __do_sys_truncate fs/open.c:147 [inline] __se_sys_truncate fs/open.c:145 [inline] __x64_sys_truncate+0x5b/0x70 fs/open.c:145 x64_sys_call+0x679/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:77 do_syscall_x64 arch/x86/entry/common.c:46 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:76 entry_SYSCALL_64_after_hwframe+0x68/0xd2 The buggy address belongs to the object at ffff888117bb60f0 which belongs to the cache f2fs_extent_tree of size 88 The buggy address is located 72 bytes inside of 88-byte region [ffff888117bb60f0, ffff888117bb6148) The buggy address belongs to the physical page: page:ffffea00045eed80 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x117bb6 flags: 0x4000000000000200(slab|zone=1) raw: 4000000000000200 0000000000000000 dead000000000122 ffff88810888b680 raw: 0000000000000000 0000000080220022 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 494, tgid 493 (syz.4.20), ts 42646662638, free_ts 42623580406 set_page_owner include/linux/page_owner.h:33 [inline] post_alloc_hook+0x1f5/0x210 mm/page_alloc.c:2673 prep_new_page+0x1c/0x110 mm/page_alloc.c:2680 get_page_from_freelist+0x2ca9/0x2d20 mm/page_alloc.c:4587 __alloc_pages+0x1fa/0x610 mm/page_alloc.c:5931 alloc_slab_page+0x6e/0xf0 include/linux/gfp.h:-1 allocate_slab mm/slub.c:1967 [inline] new_slab+0x98/0x3e0 mm/slub.c:2020 ___slab_alloc+0x70f/0xb70 mm/slub.c:3177 __slab_alloc+0x5e/0xa0 mm/slub.c:3263 slab_alloc_node mm/slub.c:3348 [inline] slab_alloc mm/slub.c:3392 [inline] __kmem_cache_alloc_lru mm/slub.c:3399 [inline] kmem_cache_alloc+0x1a8/0x320 mm/slub.c:3408 f2fs_kmem_cache_alloc fs/f2fs/f2fs.h:-1 [inline] __grab_extent_tree+0x19a/0x420 fs/f2fs/extent_cache.c:335 f2fs_init_read_extent_tree+0x3e6/0x7e0 fs/f2fs/extent_cache.c:406 do_read_inode fs/f2fs/inode.c:461 [inline] f2fs_iget+0x370d/0x5200 fs/f2fs/inode.c:520 f2fs_lookup+0x3a9/0xab0 fs/f2fs/namei.c:486 __lookup_slow+0x2d5/0x410 fs/namei.c:1697 lookup_slow+0x57/0x70 fs/namei.c:1714 walk_component+0x2f5/0x430 fs/namei.c:2005 page last free stack trace: reset_page_owner include/linux/page_owner.h:26 [inline] free_pages_prepare mm/page_alloc.c:1581 [inline] free_pcp_prepare mm/page_alloc.c:1655 [inline] free_unref_page_prepare+0x81b/0x820 mm/page_alloc.c:3622 free_unref_page+0x93/0x530 mm/page_alloc.c:3720 free_the_page mm/page_alloc.c:863 [inline] __free_pages+0x67/0x100 mm/page_alloc.c:6021 __free_slab+0xc7/0x1a0 mm/slub.c:2044 free_slab mm/slub.c:2059 [inline] discard_slab mm/slub.c:2065 [inline] __unfreeze_partials+0x15a/0x190 mm/slub.c:2614 put_cpu_partial+0xa9/0x100 mm/slub.c:2690 __slab_free+0x1c4/0x280 mm/slub.c:3589 do_slab_free mm/slub.c:3666 [inline] ___cache_free+0xbf/0xd0 mm/slub.c:3722 qlink_free mm/kasan/quarantine.c:168 [inline] qlist_free_all+0xc6/0x140 mm/kasan/quarantine.c:187 kasan_quarantine_reduce+0x14a/0x170 mm/kasan/quarantine.c:294 __kasan_slab_alloc+0x24/0x80 mm/kasan/common.c:311 kasan_slab_alloc include/linux/kasan.h:202 [inline] slab_post_alloc_hook+0x4f/0x2d0 mm/slab.h:768 slab_alloc_node mm/slub.c:3382 [inline] slab_alloc mm/slub.c:3392 [inline] __kmem_cache_alloc_lru mm/slub.c:3399 [inline] kmem_cache_alloc+0x166/0x320 mm/slub.c:3408 getname_flags+0xba/0x510 fs/namei.c:139 getname+0x19/0x20 fs/namei.c:218 do_sys_openat2+0xeb/0x820 fs/open.c:1337 Memory state around the buggy address: ffff888117bb6000: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888117bb6080: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fa fb >ffff888117bb6100: fb fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc ^ ffff888117bb6180: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888117bb6200: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ================================================================== F2FS-fs (loop4): sanity_check_extent_cache: inode (ino=8) extent info [14338, 0, 2147549187] is incorrect, run fsck to fix