syzbot


KASAN: use-after-free Read in f2fs_iget

Status: upstream: reported C repro on 2024/05/05 12:48
Bug presence: origin:lts-only
Labels: missing-backport
[Documentation on labels]
Reported-by: syzbot+0b1e85354f790743db08@syzkaller.appspotmail.com
First crash: 614d, last: 8d07h
Fix bisection: failed (error log, bisect log)
  
Bug presence (2)
Date Name Commit Repro Result
2025/12/07 linux-5.15.y (ToT) 68efe5a6c16a C [report] KASAN: use-after-free Read in f2fs_iget
2025/12/07 upstream (ToT) 37bb2e7217b0 C Didn't crash
Similar bugs (4)
Kernel Title Rank 🛈 Repro Cause bisect Fix bisect Count Last Reported Patched Status
android-5-15 KASAN: use-after-free Read in f2fs_iget origin:lts 19 C 1 4d09h 4d09h 0/2 upstream: reported C repro on 2026/01/06 01:52
android-5-10 KASAN: use-after-free Read in f2fs_iget 19 C 1 29d 153d 0/2 upstream: reported C repro on 2025/08/09 12:12
linux-6.1 UBSAN: array-index-out-of-bounds in f2fs_iget origin:upstream 15 C done 1 873d 873d 3/3 fixed on 2023/10/10 21:47
upstream UBSAN: array-index-out-of-bounds in f2fs_iget f2fs 15 C done 6 860d 905d 23/29 fixed on 2023/10/12 12:48
Last patch testing requests (8)
Created Duration User Patch Repo Result
2026/01/02 03:04 11m retest repro linux-5.15.y report log
2026/01/02 03:04 13m retest repro linux-5.15.y report log
2026/01/02 03:04 10m retest repro linux-5.15.y report log
2025/10/23 23:13 16m retest repro linux-5.15.y report log
2025/10/23 23:13 17m retest repro linux-5.15.y report log
2025/10/23 23:13 14m retest repro linux-5.15.y report log
2025/08/14 14:53 16m retest repro linux-5.15.y report log
2025/08/14 14:53 17m retest repro linux-5.15.y report log
Fix bisection attempts (10)
Created Duration User Patch Repo Result
2025/10/30 13:20 1m fix candidate upstream error job log
2025/08/01 13:48 2m fix candidate upstream error job log
2025/03/01 09:50 2m fix candidate upstream error job log
2024/12/09 17:49 14m fix candidate upstream error job log
2024/09/15 19:22 1m fix candidate upstream error job log
2024/08/06 03:11 1m fix candidate upstream error job log
2024/06/13 07:46 16m bisect fix linux-5.15.y error job log
2024/06/12 20:08 1m bisect fix linux-5.15.y error job log
2024/06/12 17:40 1m bisect fix linux-5.15.y error job log
2024/06/05 19:37 10m bisect fix linux-5.15.y error job log
marked invalid by web-security-scanner@google.com

Sample crash report:
RAX: ffffffffffffffda RBX: 00007f9157876090 RCX: 00007f915761f749
RDX: 0000000002000000 RSI: 00002000000000c0 RDI: ffffffffffffff9c
RBP: 00007f91576a3f91 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f9157876128 R14: 00007f9157876090 R15: 00007ffec583e8a8
 </TASK>
==================================================================
BUG: KASAN: use-after-free in sanity_check_inode fs/f2fs/inode.c:282 [inline]
BUG: KASAN: use-after-free in do_read_inode fs/f2fs/inode.c:422 [inline]
BUG: KASAN: use-after-free in f2fs_iget+0x4240/0x4a50 fs/f2fs/inode.c:521
Read of size 4 at addr ffff88806203ad70 by task syz.0.33/4474

CPU: 0 PID: 4474 Comm: syz.0.33 Not tainted syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/25/2025
Call Trace:
 <TASK>
 dump_stack_lvl+0x168/0x230 lib/dump_stack.c:106
 print_address_description+0x60/0x2d0 mm/kasan/report.c:248
 __kasan_report mm/kasan/report.c:434 [inline]
 kasan_report+0xdf/0x130 mm/kasan/report.c:451
 sanity_check_inode fs/f2fs/inode.c:282 [inline]
 do_read_inode fs/f2fs/inode.c:422 [inline]
 f2fs_iget+0x4240/0x4a50 fs/f2fs/inode.c:521
 f2fs_nfs_get_inode+0x72/0x100 fs/f2fs/super.c:3108
 generic_fh_to_dentry+0x8f/0xe0 fs/libfs.c:1044
 exportfs_decode_fh_raw+0x12a/0x5d0 fs/exportfs/expfs.c:436
 exportfs_decode_fh+0x36/0x70 fs/exportfs/expfs.c:576
 do_handle_to_path fs/fhandle.c:152 [inline]
 handle_to_path fs/fhandle.c:207 [inline]
 do_handle_open+0x3df/0x820 fs/fhandle.c:223
 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:0x7f915761f749
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:00007f9156c6d038 EFLAGS: 00000246 ORIG_RAX: 0000000000000130
RAX: ffffffffffffffda RBX: 00007f9157876090 RCX: 00007f915761f749
RDX: 0000000002000000 RSI: 00002000000000c0 RDI: ffffffffffffff9c
RBP: 00007f91576a3f91 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f9157876128 R14: 00007f9157876090 R15: 00007ffec583e8a8
 </TASK>

Allocated by task 4469:
 kasan_save_stack mm/kasan/common.c:38 [inline]
 kasan_set_track mm/kasan/common.c:46 [inline]
 set_alloc_info mm/kasan/common.c:434 [inline]
 __kasan_slab_alloc+0x9c/0xd0 mm/kasan/common.c:467
 kasan_slab_alloc include/linux/kasan.h:254 [inline]
 slab_post_alloc_hook+0x4c/0x380 mm/slab.h:519
 slab_alloc_node mm/slub.c:3225 [inline]
 slab_alloc mm/slub.c:3233 [inline]
 kmem_cache_alloc+0x100/0x290 mm/slub.c:3238
 f2fs_kmem_cache_alloc_nofail fs/f2fs/f2fs.h:2631 [inline]
 f2fs_kmem_cache_alloc fs/f2fs/f2fs.h:2641 [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+0x518/0xae0 fs/f2fs/extent_cache.c:404
 do_read_inode fs/f2fs/inode.c:399 [inline]
 f2fs_iget+0xfe4/0x4a50 fs/f2fs/inode.c:521
 f2fs_nfs_get_inode+0x72/0x100 fs/f2fs/super.c:3108
 generic_fh_to_dentry+0x8f/0xe0 fs/libfs.c:1044
 exportfs_decode_fh_raw+0x12a/0x5d0 fs/exportfs/expfs.c:436
 exportfs_decode_fh+0x36/0x70 fs/exportfs/expfs.c:576
 do_handle_to_path fs/fhandle.c:152 [inline]
 handle_to_path fs/fhandle.c:207 [inline]
 do_handle_open+0x3df/0x820 fs/fhandle.c:223
 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 4469:
 kasan_save_stack mm/kasan/common.c:38 [inline]
 kasan_set_track+0x4b/0x70 mm/kasan/common.c:46
 kasan_set_free_info+0x1f/0x40 mm/kasan/generic.c:360
 ____kasan_slab_free+0xd5/0x110 mm/kasan/common.c:366
 kasan_slab_free include/linux/kasan.h:230 [inline]
 slab_free_hook mm/slub.c:1710 [inline]
 slab_free_freelist_hook+0xea/0x170 mm/slub.c:1736
 slab_free mm/slub.c:3504 [inline]
 kmem_cache_free+0x8f/0x210 mm/slub.c:3520
 f2fs_destroy_extent_tree+0x3b3/0x670 fs/f2fs/extent_cache.c:845
 f2fs_evict_inode+0x3c4/0x15b0 fs/f2fs/inode.c:776
 evict+0x485/0x870 fs/inode.c:647
 f2fs_iget+0x16ad/0x4a50 fs/f2fs/inode.c:573
 f2fs_nfs_get_inode+0x72/0x100 fs/f2fs/super.c:3108
 generic_fh_to_dentry+0x8f/0xe0 fs/libfs.c:1044
 exportfs_decode_fh_raw+0x12a/0x5d0 fs/exportfs/expfs.c:436
 exportfs_decode_fh+0x36/0x70 fs/exportfs/expfs.c:576
 do_handle_to_path fs/fhandle.c:152 [inline]
 handle_to_path fs/fhandle.c:207 [inline]
 do_handle_open+0x3df/0x820 fs/fhandle.c:223
 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 ffff88806203ad48
 which belongs to the cache f2fs_extent_tree of size 136
The buggy address is located 40 bytes inside of
 136-byte region [ffff88806203ad48, ffff88806203add0)
The buggy address belongs to the page:
page:ffffea0001880e80 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x6203a
flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff)
raw: 00fff00000000200 0000000000000000 dead000000000122 ffff88801dc40c80
raw: 0000000000000000 0000000080140014 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 4356, ts 66922724868, free_ts 55697178993
 prep_new_page mm/page_alloc.c:2426 [inline]
 get_page_from_freelist+0x1b77/0x1c60 mm/page_alloc.c:4192
 __alloc_pages+0x1e1/0x470 mm/page_alloc.c:5487
 alloc_slab_page mm/slub.c:1780 [inline]
 allocate_slab mm/slub.c:1917 [inline]
 new_slab+0xc0/0x4b0 mm/slub.c:1980
 ___slab_alloc+0x81e/0xdf0 mm/slub.c:3013
 __slab_alloc mm/slub.c:3100 [inline]
 slab_alloc_node mm/slub.c:3191 [inline]
 slab_alloc mm/slub.c:3233 [inline]
 kmem_cache_alloc+0x195/0x290 mm/slub.c:3238
 f2fs_kmem_cache_alloc_nofail fs/f2fs/f2fs.h:2631 [inline]
 f2fs_kmem_cache_alloc fs/f2fs/f2fs.h:2641 [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+0x518/0xae0 fs/f2fs/extent_cache.c:404
 do_read_inode fs/f2fs/inode.c:399 [inline]
 f2fs_iget+0xfe4/0x4a50 fs/f2fs/inode.c:521
 f2fs_nfs_get_inode+0x72/0x100 fs/f2fs/super.c:3108
 generic_fh_to_dentry+0x8f/0xe0 fs/libfs.c:1044
 exportfs_decode_fh_raw+0x12a/0x5d0 fs/exportfs/expfs.c:436
 exportfs_decode_fh+0x36/0x70 fs/exportfs/expfs.c:576
 do_handle_to_path fs/fhandle.c:152 [inline]
 handle_to_path fs/fhandle.c:207 [inline]
 do_handle_open+0x3df/0x820 fs/fhandle.c:223
 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
page last free stack trace:
 reset_page_owner include/linux/page_owner.h:24 [inline]
 free_pages_prepare mm/page_alloc.c:1340 [inline]
 free_pcp_prepare mm/page_alloc.c:1391 [inline]
 free_unref_page_prepare+0x637/0x6c0 mm/page_alloc.c:3317
 free_unref_page_list+0x122/0x7e0 mm/page_alloc.c:3433
 release_pages+0x184b/0x1bb0 mm/swap.c:963
 tlb_batch_pages_flush mm/mmu_gather.c:49 [inline]
 tlb_flush_mmu_free mm/mmu_gather.c:240 [inline]
 tlb_flush_mmu mm/mmu_gather.c:247 [inline]
 tlb_finish_mmu+0x164/0x2e0 mm/mmu_gather.c:338
 unmap_region+0x315/0x360 mm/mmap.c:2669
 __do_munmap+0x9d3/0xdc0 mm/mmap.c:2899
 __vm_munmap+0x137/0x230 mm/mmap.c:2952
 __do_sys_munmap mm/mmap.c:2978 [inline]
 __se_sys_munmap mm/mmap.c:2974 [inline]
 __x64_sys_munmap+0x67/0x70 mm/mmap.c:2974
 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

Memory state around the buggy address:
 ffff88806203ac00: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc
 ffff88806203ac80: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff88806203ad00: fb fc fc fc fc fc fc fc fc fa fb fb fb fb fb fb
                                                             ^
 ffff88806203ad80: fb fb fb fb fb fb fb fb fb fb fc fc fc fc fc fc
 ffff88806203ae00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
==================================================================

Crashes (6):
Time Kernel Commit Syzkaller Config Log Report Syz repro C repro VM info Assets (help?) Manager Title
2025/12/05 22:45 linux-5.15.y cc5ec8769306 d6526ea3 .config console log report syz / log C [disk image] [vmlinux] [kernel image] [mounted in repro (corrupt fs)] ci2-linux-5-15-kasan KASAN: use-after-free Read in f2fs_iget
2025/05/19 08:59 linux-5.15.y a68c15152131 f41472b0 .config console log report syz / log C [disk image] [vmlinux] [kernel image] [mounted in repro (corrupt fs)] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Read in f2fs_iget
2025/05/03 17:45 linux-5.15.y 16fdf2c7111b b0714e37 .config console log report syz / log C [disk image] [vmlinux] [kernel image] [mounted in repro (corrupt fs)] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Read in f2fs_iget
2024/05/05 13:43 linux-5.15.y 284087d4f7d5 610f2a54 .config console log report syz C [disk image] [vmlinux] [kernel image] [mounted in repro] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Read in f2fs_iget
2025/12/05 21:38 linux-5.15.y cc5ec8769306 d6526ea3 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan KASAN: use-after-free Read in f2fs_iget
2024/05/05 12:48 linux-5.15.y 284087d4f7d5 610f2a54 .config console log report info [disk image] [vmlinux] [kernel image] ci2-linux-5-15-kasan-arm64 KASAN: use-after-free Read in f2fs_iget
* Struck through repros no longer work on HEAD.