bisecting fixing commit since 811218eceeaa7618652e1b8d11caeff67ab42072 building syzkaller on 14052202e8d8d0bb407512b6861e9085f9171241 testing commit 811218eceeaa7618652e1b8d11caeff67ab42072 compiler: gcc version 8.4.1 20210217 (GCC) kernel signature: 6a164d760a2805ccda0f5b940be62cc0d1e420be598f038612ea7cf010c9770e all runs: crashed: KASAN: use-after-free Read in f2fs_evict_inode testing current HEAD 2950c9c5e0df6bd34af45a5168bbee345e95eae2 testing commit 2950c9c5e0df6bd34af45a5168bbee345e95eae2 compiler: gcc version 8.4.1 20210217 (GCC) kernel signature: 35c3f2dfb919259044f1b9203490f49795b58262167495b6d9c1f267ef711ff2 all runs: crashed: KASAN: use-after-free Read in f2fs_evict_inode revisions tested: 2, total time: 26m7.001259157s (build: 18m16.437565096s, test: 7m15.915585822s) the crash still happens on HEAD commit msg: Linux 4.19.207 crash: KASAN: use-after-free Read in f2fs_evict_inode F2FS-fs (loop5): Try to recover 2th superblock, ret: 0 F2FS-fs (loop5): Mounted with checkpoint version = 1e177019 F2FS-fs (loop1): f2fs_check_nid_range: out-of-range nid=2, run fsck to fix. ================================================================== BUG: KASAN: use-after-free in f2fs_evict_inode+0xd4e/0x1000 fs/f2fs/inode.c:650 Read of size 4 at addr ffff8880aa5f63d0 by task syz-executor.3/11373 CPU: 0 PID: 11373 Comm: syz-executor.3 Not tainted 4.19.207-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:77 [inline] dump_stack+0x17c/0x226 lib/dump_stack.c:118 print_address_description.cold.6+0x9/0x211 mm/kasan/report.c:256 kasan_report_error mm/kasan/report.c:354 [inline] kasan_report mm/kasan/report.c:412 [inline] kasan_report.cold.7+0x242/0x2fe mm/kasan/report.c:396 __asan_report_load4_noabort+0x14/0x20 mm/kasan/report.c:432 f2fs_evict_inode+0xd4e/0x1000 fs/f2fs/inode.c:650 evict+0x29c/0x590 fs/inode.c:559 iput_final fs/inode.c:1555 [inline] iput fs/inode.c:1581 [inline] iput+0x378/0x6b0 fs/inode.c:1567 dentry_unlink_inode+0x22d/0x2e0 fs/dcache.c:374 __dentry_kill+0x2d1/0x550 fs/dcache.c:566 dentry_kill+0x94/0x3f0 fs/dcache.c:685 shrink_dentry_list+0x1fa/0x510 fs/dcache.c:1092 shrink_dcache_sb+0x110/0x1b0 fs/dcache.c:1212 f2fs_fill_super fs/f2fs/super.c:3225 [inline] f2fs_fill_super+0xefd/0x70f0 fs/f2fs/super.c:2803 mount_bdev+0x26f/0x330 fs/super.c:1158 f2fs_mount+0x10/0x20 fs/f2fs/super.c:3234 mount_fs+0x7f/0x2b0 fs/super.c:1261 vfs_kern_mount.part.11+0x58/0x3d0 fs/namespace.c:961 vfs_kern_mount fs/namespace.c:951 [inline] do_new_mount fs/namespace.c:2492 [inline] do_mount+0x376/0x2630 fs/namespace.c:2822 ksys_mount+0xb1/0xd0 fs/namespace.c:3038 __do_sys_mount fs/namespace.c:3052 [inline] __se_sys_mount fs/namespace.c:3049 [inline] __x64_sys_mount+0xb9/0x150 fs/namespace.c:3049 do_syscall_64+0xd0/0x4e0 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x4672ba Code: 48 c7 c2 bc ff ff ff f7 d8 64 89 02 b8 ff ff ff ff eb d2 e8 b8 04 00 00 0f 1f 84 00 00 00 00 00 49 89 ca b8 a5 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 bc ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f3d863dffa8 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5 RAX: ffffffffffffffda RBX: 0000000020000200 RCX: 00000000004672ba RDX: 0000000020000000 RSI: 0000000020000100 RDI: 00007f3d863e0000 RBP: 00007f3d863e0040 R08: 00007f3d863e0040 R09: 0000000020000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000020000000 R13: 0000000020000100 R14: 00007f3d863e0000 R15: 0000000020000300 Allocated by task 11373: save_stack mm/kasan/kasan.c:448 [inline] set_track mm/kasan/kasan.c:460 [inline] kasan_kmalloc.part.1+0x62/0xf0 mm/kasan/kasan.c:553 kasan_kmalloc+0xaf/0xc0 mm/kasan/kasan.c:538 kmem_cache_alloc_trace+0x152/0x3a0 mm/slab.c:3625 kmalloc include/linux/slab.h:515 [inline] kzalloc include/linux/slab.h:709 [inline] f2fs_fill_super fs/f2fs/super.c:2821 [inline] f2fs_fill_super+0xe8/0x70f0 fs/f2fs/super.c:2803 mount_bdev+0x26f/0x330 fs/super.c:1158 f2fs_mount+0x10/0x20 fs/f2fs/super.c:3234 mount_fs+0x7f/0x2b0 fs/super.c:1261 vfs_kern_mount.part.11+0x58/0x3d0 fs/namespace.c:961 vfs_kern_mount fs/namespace.c:951 [inline] do_new_mount fs/namespace.c:2492 [inline] do_mount+0x376/0x2630 fs/namespace.c:2822 ksys_mount+0xb1/0xd0 fs/namespace.c:3038 __do_sys_mount fs/namespace.c:3052 [inline] __se_sys_mount fs/namespace.c:3049 [inline] __x64_sys_mount+0xb9/0x150 fs/namespace.c:3049 do_syscall_64+0xd0/0x4e0 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 11373: save_stack mm/kasan/kasan.c:448 [inline] set_track mm/kasan/kasan.c:460 [inline] __kasan_slab_free+0x13c/0x220 mm/kasan/kasan.c:521 kasan_slab_free+0xe/0x10 mm/kasan/kasan.c:528 __cache_free mm/slab.c:3503 [inline] kfree+0xcf/0x220 mm/slab.c:3822 f2fs_fill_super fs/f2fs/super.c:3220 [inline] f2fs_fill_super+0xee8/0x70f0 fs/f2fs/super.c:2803 mount_bdev+0x26f/0x330 fs/super.c:1158 f2fs_mount+0x10/0x20 fs/f2fs/super.c:3234 mount_fs+0x7f/0x2b0 fs/super.c:1261 vfs_kern_mount.part.11+0x58/0x3d0 fs/namespace.c:961 vfs_kern_mount fs/namespace.c:951 [inline] do_new_mount fs/namespace.c:2492 [inline] do_mount+0x376/0x2630 fs/namespace.c:2822 ksys_mount+0xb1/0xd0 fs/namespace.c:3038 __do_sys_mount fs/namespace.c:3052 [inline] __se_sys_mount fs/namespace.c:3049 [inline] __x64_sys_mount+0xb9/0x150 fs/namespace.c:3049 do_syscall_64+0xd0/0x4e0 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe The buggy address belongs to the object at ffff8880aa5f5680 which belongs to the cache kmalloc-8192 of size 8192 The buggy address is located 3408 bytes inside of 8192-byte region [ffff8880aa5f5680, ffff8880aa5f7680) The buggy address belongs to the page: page:ffffea0002a97d00 count:1 mapcount:0 mapping:ffff88813bff5080 index:0x0 compound_mapcount: 0 flags: 0xfff00000008100(slab|head) raw: 00fff00000008100 ffffea0001f9dd08 ffffea0002583908 ffff88813bff5080 raw: 0000000000000000 ffff8880aa5f5680 0000000100000001 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8880aa5f6280: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880aa5f6300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8880aa5f6380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8880aa5f6400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880aa5f6480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================