================================================================== BUG: KASAN: use-after-free in sanity_check_inode fs/f2fs/inode.c:287 [inline] BUG: KASAN: use-after-free in do_read_inode fs/f2fs/inode.c:427 [inline] BUG: KASAN: use-after-free in f2fs_iget+0x487c/0x5230 fs/f2fs/inode.c:539 Read of size 4 at addr ffff888120a86098 by task syz.5.17/435 CPU: 1 PID: 435 Comm: syz.5.17 Not tainted syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/25/2025 Call Trace: __dump_stack+0x21/0x30 lib/dump_stack.c:88 dump_stack_lvl+0xee/0x150 lib/dump_stack.c:106 print_address_description+0x7f/0x2c0 mm/kasan/report.c:248 __kasan_report mm/kasan/report.c:427 [inline] kasan_report+0xf1/0x140 mm/kasan/report.c:444 __asan_report_load4_noabort+0x14/0x20 mm/kasan/report_generic.c:308 sanity_check_inode fs/f2fs/inode.c:287 [inline] do_read_inode fs/f2fs/inode.c:427 [inline] f2fs_iget+0x487c/0x5230 fs/f2fs/inode.c:539 f2fs_lookup+0x366/0xab0 fs/f2fs/namei.c:493 lookup_open fs/namei.c:3448 [inline] open_last_lookups fs/namei.c:3540 [inline] path_openat+0xfcf/0x2f10 fs/namei.c:3747 do_filp_open+0x1b3/0x3e0 fs/namei.c:3777 do_sys_openat2+0x14c/0x7b0 fs/open.c:1236 do_sys_open fs/open.c:1252 [inline] __do_sys_openat fs/open.c:1268 [inline] __se_sys_openat fs/open.c:1263 [inline] __x64_sys_openat+0x136/0x160 fs/open.c:1263 x64_sys_call+0x219/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:258 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 RIP: 0033:0x7f76f640c749 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:00007f76f625b038 EFLAGS: 00000246 ORIG_RAX: 0000000000000101 RAX: ffffffffffffffda RBX: 00007f76f6663090 RCX: 00007f76f640c749 RDX: 0000000000101000 RSI: 0000200000000080 RDI: ffffffffffffff9c RBP: 00007f76f6490f91 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000001 R11: 0000000000000246 R12: 0000000000000000 R13: 00007f76f6663128 R14: 00007f76f6663090 R15: 00007fff917ae288 Allocated by task 422: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track mm/kasan/common.c:45 [inline] set_alloc_info mm/kasan/common.c:433 [inline] __kasan_slab_alloc+0xbd/0xf0 mm/kasan/common.c:466 kasan_slab_alloc include/linux/kasan.h:217 [inline] slab_post_alloc_hook+0x4f/0x2b0 mm/slab.h:550 slab_alloc_node mm/slub.c:3245 [inline] slab_alloc mm/slub.c:3255 [inline] kmem_cache_alloc+0xf7/0x260 mm/slub.c:3260 f2fs_kmem_cache_alloc fs/f2fs/f2fs.h:-1 [inline] __grab_extent_tree fs/f2fs/extent_cache.c:295 [inline] __f2fs_init_extent_tree fs/f2fs/extent_cache.c:381 [inline] f2fs_init_extent_tree+0x4b9/0xc70 fs/f2fs/extent_cache.c:404 do_read_inode fs/f2fs/inode.c:404 [inline] f2fs_iget+0x13c9/0x5230 fs/f2fs/inode.c:539 f2fs_lookup+0x366/0xab0 fs/f2fs/namei.c:493 __lookup_slow+0x2aa/0x3e0 fs/namei.c:1671 lookup_slow+0x57/0x70 fs/namei.c:1688 walk_component+0x325/0x460 fs/namei.c:1984 lookup_last fs/namei.c:2439 [inline] path_lookupat+0x180/0x490 fs/namei.c:2463 filename_lookup+0x1e2/0x4f0 fs/namei.c:2492 user_path_at_empty+0x47/0x1c0 fs/namei.c:2891 user_path_at include/linux/namei.h:57 [inline] do_sys_truncate+0xa3/0x190 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+0x212/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:77 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 Freed by task 422: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track+0x4a/0x70 mm/kasan/common.c:45 kasan_set_free_info+0x23/0x40 mm/kasan/generic.c:370 ____kasan_slab_free+0x125/0x160 mm/kasan/common.c:365 __kasan_slab_free+0x11/0x20 mm/kasan/common.c:373 kasan_slab_free include/linux/kasan.h:193 [inline] slab_free_hook mm/slub.c:1728 [inline] slab_free_freelist_hook+0xc2/0x190 mm/slub.c:1754 slab_free mm/slub.c:3526 [inline] kmem_cache_free+0x100/0x320 mm/slub.c:3544 f2fs_destroy_extent_tree+0x2c0/0x4b0 fs/f2fs/extent_cache.c:845 f2fs_evict_inode+0x4f0/0x1600 fs/f2fs/inode.c:812 evict+0x485/0x870 fs/inode.c:650 iput_final fs/inode.c:1779 [inline] iput+0x635/0x7c0 fs/inode.c:1805 iget_failed+0x17a/0x1c0 fs/bad_inode.c:250 f2fs_iget+0x1aeb/0x5230 fs/f2fs/inode.c:600 f2fs_lookup+0x366/0xab0 fs/f2fs/namei.c:493 __lookup_slow+0x2aa/0x3e0 fs/namei.c:1671 lookup_slow+0x57/0x70 fs/namei.c:1688 walk_component+0x325/0x460 fs/namei.c:1984 lookup_last fs/namei.c:2439 [inline] path_lookupat+0x180/0x490 fs/namei.c:2463 filename_lookup+0x1e2/0x4f0 fs/namei.c:2492 user_path_at_empty+0x47/0x1c0 fs/namei.c:2891 user_path_at include/linux/namei.h:57 [inline] do_sys_truncate+0xa3/0x190 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+0x212/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:77 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 The buggy address belongs to the object at ffff888120a86070 which belongs to the cache f2fs_extent_tree of size 80 The buggy address is located 40 bytes inside of 80-byte region [ffff888120a86070, ffff888120a860c0) The buggy address belongs to the page: page:ffffea000482a180 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x120a86 flags: 0x4000000000000200(slab|zone=1) raw: 4000000000000200 0000000000000000 dead000000000122 ffff8881081f8d80 raw: 0000000000000000 0000000080240024 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 422, ts 38544235908, free_ts 0 set_page_owner include/linux/page_owner.h:33 [inline] post_alloc_hook+0x192/0x1b0 mm/page_alloc.c:2605 prep_new_page+0x1c/0x110 mm/page_alloc.c:2611 get_page_from_freelist+0x2cc5/0x2d50 mm/page_alloc.c:4485 __alloc_pages+0x18f/0x440 mm/page_alloc.c:5808 alloc_slab_page mm/slub.c:-1 [inline] allocate_slab mm/slub.c:1937 [inline] new_slab+0xa1/0x4d0 mm/slub.c:2000 ___slab_alloc+0x381/0x810 mm/slub.c:3033 __slab_alloc+0x49/0x90 mm/slub.c:3120 slab_alloc_node mm/slub.c:3211 [inline] slab_alloc mm/slub.c:3255 [inline] kmem_cache_alloc+0x138/0x260 mm/slub.c:3260 f2fs_kmem_cache_alloc fs/f2fs/f2fs.h:-1 [inline] __grab_extent_tree fs/f2fs/extent_cache.c:295 [inline] __f2fs_init_extent_tree fs/f2fs/extent_cache.c:381 [inline] f2fs_init_extent_tree+0x4b9/0xc70 fs/f2fs/extent_cache.c:404 do_read_inode fs/f2fs/inode.c:404 [inline] f2fs_iget+0x13c9/0x5230 fs/f2fs/inode.c:539 f2fs_lookup+0x366/0xab0 fs/f2fs/namei.c:493 __lookup_slow+0x2aa/0x3e0 fs/namei.c:1671 lookup_slow+0x57/0x70 fs/namei.c:1688 walk_component+0x325/0x460 fs/namei.c:1984 lookup_last fs/namei.c:2439 [inline] path_lookupat+0x180/0x490 fs/namei.c:2463 filename_lookup+0x1e2/0x4f0 fs/namei.c:2492 page_owner free stack trace missing Memory state around the buggy address: ffff888120a85f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888120a86000: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fa fb >ffff888120a86080: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ^ ffff888120a86100: fc fc fc fc fc fc fc fc fc fc 00 00 00 00 00 00 ffff888120a86180: 00 00 00 00 fc fc fc fc fc fc fc fc fc fc fc fc ================================================================== F2FS-fs (loop5): sanity_check_inode: inode (ino=8) extent info [14338, 0, 2147549187] is incorrect, run fsck to fix ================================================================== BUG: KASAN: double-free or invalid-free in slab_free mm/slub.c:3526 [inline] BUG: KASAN: double-free or invalid-free in kmem_cache_free+0x100/0x320 mm/slub.c:3544 CPU: 1 PID: 435 Comm: syz.5.17 Tainted: G B syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/25/2025 Call Trace: __dump_stack+0x21/0x30 lib/dump_stack.c:88 dump_stack_lvl+0xee/0x150 lib/dump_stack.c:106 print_address_description+0x7f/0x2c0 mm/kasan/report.c:248 kasan_report_invalid_free+0x58/0x90 mm/kasan/report.c:370 ____kasan_slab_free+0x13d/0x160 mm/kasan/common.c:-1 __kasan_slab_free+0x11/0x20 mm/kasan/common.c:373 kasan_slab_free include/linux/kasan.h:193 [inline] slab_free_hook mm/slub.c:1728 [inline] slab_free_freelist_hook+0xc2/0x190 mm/slub.c:1754 slab_free mm/slub.c:3526 [inline] kmem_cache_free+0x100/0x320 mm/slub.c:3544 f2fs_destroy_extent_tree+0x2c0/0x4b0 fs/f2fs/extent_cache.c:845 f2fs_evict_inode+0x4f0/0x1600 fs/f2fs/inode.c:812 evict+0x485/0x870 fs/inode.c:650 iput_final fs/inode.c:1779 [inline] iput+0x635/0x7c0 fs/inode.c:1805 iget_failed+0x17a/0x1c0 fs/bad_inode.c:250 f2fs_iget+0x1aeb/0x5230 fs/f2fs/inode.c:600 f2fs_lookup+0x366/0xab0 fs/f2fs/namei.c:493 lookup_open fs/namei.c:3448 [inline] open_last_lookups fs/namei.c:3540 [inline] path_openat+0xfcf/0x2f10 fs/namei.c:3747 do_filp_open+0x1b3/0x3e0 fs/namei.c:3777 do_sys_openat2+0x14c/0x7b0 fs/open.c:1236 do_sys_open fs/open.c:1252 [inline] __do_sys_openat fs/open.c:1268 [inline] __se_sys_openat fs/open.c:1263 [inline] __x64_sys_openat+0x136/0x160 fs/open.c:1263 x64_sys_call+0x219/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:258 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 RIP: 0033:0x7f76f640c749 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:00007f76f625b038 EFLAGS: 00000246 ORIG_RAX: 0000000000000101 RAX: ffffffffffffffda RBX: 00007f76f6663090 RCX: 00007f76f640c749 RDX: 0000000000101000 RSI: 0000200000000080 RDI: ffffffffffffff9c RBP: 00007f76f6490f91 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000001 R11: 0000000000000246 R12: 0000000000000000 R13: 00007f76f6663128 R14: 00007f76f6663090 R15: 00007fff917ae288 Allocated by task 422: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track mm/kasan/common.c:45 [inline] set_alloc_info mm/kasan/common.c:433 [inline] __kasan_slab_alloc+0xbd/0xf0 mm/kasan/common.c:466 kasan_slab_alloc include/linux/kasan.h:217 [inline] slab_post_alloc_hook+0x4f/0x2b0 mm/slab.h:550 slab_alloc_node mm/slub.c:3245 [inline] slab_alloc mm/slub.c:3255 [inline] kmem_cache_alloc+0xf7/0x260 mm/slub.c:3260 f2fs_kmem_cache_alloc fs/f2fs/f2fs.h:-1 [inline] __grab_extent_tree fs/f2fs/extent_cache.c:295 [inline] __f2fs_init_extent_tree fs/f2fs/extent_cache.c:381 [inline] f2fs_init_extent_tree+0x4b9/0xc70 fs/f2fs/extent_cache.c:404 do_read_inode fs/f2fs/inode.c:404 [inline] f2fs_iget+0x13c9/0x5230 fs/f2fs/inode.c:539 f2fs_lookup+0x366/0xab0 fs/f2fs/namei.c:493 __lookup_slow+0x2aa/0x3e0 fs/namei.c:1671 lookup_slow+0x57/0x70 fs/namei.c:1688 walk_component+0x325/0x460 fs/namei.c:1984 lookup_last fs/namei.c:2439 [inline] path_lookupat+0x180/0x490 fs/namei.c:2463 filename_lookup+0x1e2/0x4f0 fs/namei.c:2492 user_path_at_empty+0x47/0x1c0 fs/namei.c:2891 user_path_at include/linux/namei.h:57 [inline] do_sys_truncate+0xa3/0x190 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+0x212/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:77 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 Freed by task 422: kasan_save_stack mm/kasan/common.c:38 [inline] kasan_set_track+0x4a/0x70 mm/kasan/common.c:45 kasan_set_free_info+0x23/0x40 mm/kasan/generic.c:370 ____kasan_slab_free+0x125/0x160 mm/kasan/common.c:365 __kasan_slab_free+0x11/0x20 mm/kasan/common.c:373 kasan_slab_free include/linux/kasan.h:193 [inline] slab_free_hook mm/slub.c:1728 [inline] slab_free_freelist_hook+0xc2/0x190 mm/slub.c:1754 slab_free mm/slub.c:3526 [inline] kmem_cache_free+0x100/0x320 mm/slub.c:3544 f2fs_destroy_extent_tree+0x2c0/0x4b0 fs/f2fs/extent_cache.c:845 f2fs_evict_inode+0x4f0/0x1600 fs/f2fs/inode.c:812 evict+0x485/0x870 fs/inode.c:650 iput_final fs/inode.c:1779 [inline] iput+0x635/0x7c0 fs/inode.c:1805 iget_failed+0x17a/0x1c0 fs/bad_inode.c:250 f2fs_iget+0x1aeb/0x5230 fs/f2fs/inode.c:600 f2fs_lookup+0x366/0xab0 fs/f2fs/namei.c:493 __lookup_slow+0x2aa/0x3e0 fs/namei.c:1671 lookup_slow+0x57/0x70 fs/namei.c:1688 walk_component+0x325/0x460 fs/namei.c:1984 lookup_last fs/namei.c:2439 [inline] path_lookupat+0x180/0x490 fs/namei.c:2463 filename_lookup+0x1e2/0x4f0 fs/namei.c:2492 user_path_at_empty+0x47/0x1c0 fs/namei.c:2891 user_path_at include/linux/namei.h:57 [inline] do_sys_truncate+0xa3/0x190 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+0x212/0x9a0 arch/x86/include/generated/asm/syscalls_64.h:77 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x4c/0xa0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x66/0xd0 The buggy address belongs to the object at ffff888120a86070 which belongs to the cache f2fs_extent_tree of size 80 The buggy address is located 0 bytes inside of 80-byte region [ffff888120a86070, ffff888120a860c0) The buggy address belongs to the page: page:ffffea000482a180 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x120a86 flags: 0x4000000000000200(slab|zone=1) raw: 4000000000000200 0000000000000000 dead000000000122 ffff8881081f8d80 raw: 0000000000000000 0000000080240024 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 422, ts 38544235908, free_ts 0 set_page_owner include/linux/page_owner.h:33 [inline] post_alloc_hook+0x192/0x1b0 mm/page_alloc.c:2605 prep_new_page+0x1c/0x110 mm/page_alloc.c:2611 get_page_from_freelist+0x2cc5/0x2d50 mm/page_alloc.c:4485 __alloc_pages+0x18f/0x440 mm/page_alloc.c:5808 alloc_slab_page mm/slub.c:-1 [inline] allocate_slab mm/slub.c:1937 [inline] new_slab+0xa1/0x4d0 mm/slub.c:2000 ___slab_alloc+0x381/0x810 mm/slub.c:3033 __slab_alloc+0x49/0x90 mm/slub.c:3120 slab_alloc_node mm/slub.c:3211 [inline] slab_alloc mm/slub.c:3255 [inline] kmem_cache_alloc+0x138/0x260 mm/slub.c:3260 f2fs_kmem_cache_alloc fs/f2fs/f2fs.h:-1 [inline] __grab_extent_tree fs/f2fs/extent_cache.c:295 [inline] __f2fs_init_extent_tree fs/f2fs/extent_cache.c:381 [inline] f2fs_init_extent_tree+0x4b9/0xc70 fs/f2fs/extent_cache.c:404 do_read_inode fs/f2fs/inode.c:404 [inline] f2fs_iget+0x13c9/0x5230 fs/f2fs/inode.c:539 f2fs_lookup+0x366/0xab0 fs/f2fs/namei.c:493 __lookup_slow+0x2aa/0x3e0 fs/namei.c:1671 lookup_slow+0x57/0x70 fs/namei.c:1688 walk_component+0x325/0x460 fs/namei.c:1984 lookup_last fs/namei.c:2439 [inline] path_lookupat+0x180/0x490 fs/namei.c:2463 filename_lookup+0x1e2/0x4f0 fs/namei.c:2492 page_owner free stack trace missing Memory state around the buggy address: ffff888120a85f00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff888120a85f80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff888120a86000: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fa fb ^ ffff888120a86080: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff888120a86100: fc fc fc fc fc fc fc fc fc fc fa fb fb fb fb fb ==================================================================