bisecting fixing commit since ad326970d25cc85128cd22d62398751ad072efff building syzkaller on a1839e81524f4e427a4b57bca0e4633d459d3d18 testing commit ad326970d25cc85128cd22d62398751ad072efff with gcc (GCC) 8.1.0 kernel signature: e2bee71469d0a3087ba19489663e3c1793893ce329f5d394eafb24275e9afcc5 all runs: crashed: KASAN: use-after-free Read in f2fs_evict_inode testing current HEAD 13d2ce42de8cb98ff952f8de6307f896203854c2 testing commit 13d2ce42de8cb98ff952f8de6307f896203854c2 with gcc (GCC) 8.1.0 kernel signature: fad53064269d9918936a7d1022884205bad73895f9c85c68acc3b55f3130bb16 all runs: crashed: KASAN: use-after-free Read in f2fs_evict_inode revisions tested: 2, total time: 25m59.570526484s (build: 17m19.853519839s, test: 7m54.46521015s) the crash still happens on HEAD commit msg: Linux 4.19.163 crash: KASAN: use-after-free Read in f2fs_evict_inode F2FS-fs (loop1): Can't find valid F2FS filesystem in 2th superblock F2FS-fs (loop4): f2fs_check_nid_range: out-of-range nid=1, run fsck to fix. F2FS-fs (loop3): f2fs_check_nid_range: out-of-range nid=1, 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 ffff8881dbd41650 by task syz-executor.5/15179 CPU: 0 PID: 15179 Comm: syz-executor.5 Not tainted 4.19.163-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/0x22a 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.cold.7+0x242/0x307 mm/kasan/report.c:412 __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+0x378/0x6b0 fs/inode.c:1581 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+0xefd/0x70c0 fs/f2fs/super.c:3225 mount_bdev+0x26f/0x330 fs/super.c:1158 f2fs_mount+0x10/0x20 fs/f2fs/super.c:3234 mount_fs+0x7f/0x2a2 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:2469 [inline] do_mount+0x376/0x2710 fs/namespace.c:2799 ksys_mount+0xba/0xe0 fs/namespace.c:3015 __do_sys_mount fs/namespace.c:3029 [inline] __se_sys_mount fs/namespace.c:3026 [inline] __x64_sys_mount+0xb9/0x150 fs/namespace.c:3026 do_syscall_64+0xd0/0x4e0 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe RIP: 0033:0x4608aa Code: b8 a6 00 00 00 0f 05 48 3d 01 f0 ff ff 0f 83 ad 89 fb ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 49 89 ca b8 a5 00 00 00 0f 05 <48> 3d 01 f0 ff ff 0f 83 8a 89 fb ff c3 66 0f 1f 84 00 00 00 00 00 RSP: 002b:00007f90221b7a88 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5 RAX: ffffffffffffffda RBX: 00007f90221b7b20 RCX: 00000000004608aa RDX: 0000000020000000 RSI: 0000000020000100 RDI: 00007f90221b7ae0 RBP: 00007f90221b7ae0 R08: 00007f90221b7b20 R09: 0000000020000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000020000000 R13: 0000000020000100 R14: 0000000020000200 R15: 0000000020000880 Allocated by task 15179: 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+0xe8/0x70c0 fs/f2fs/super.c:2821 mount_bdev+0x26f/0x330 fs/super.c:1158 f2fs_mount+0x10/0x20 fs/f2fs/super.c:3234 mount_fs+0x7f/0x2a2 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:2469 [inline] do_mount+0x376/0x2710 fs/namespace.c:2799 ksys_mount+0xba/0xe0 fs/namespace.c:3015 __do_sys_mount fs/namespace.c:3029 [inline] __se_sys_mount fs/namespace.c:3026 [inline] __x64_sys_mount+0xb9/0x150 fs/namespace.c:3026 do_syscall_64+0xd0/0x4e0 arch/x86/entry/common.c:293 entry_SYSCALL_64_after_hwframe+0x49/0xbe Freed by task 15179: 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+0xee8/0x70c0 fs/f2fs/super.c:3220 mount_bdev+0x26f/0x330 fs/super.c:1158 f2fs_mount+0x10/0x20 fs/f2fs/super.c:3234 mount_fs+0x7f/0x2a2 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:2469 [inline] do_mount+0x376/0x2710 fs/namespace.c:2799 ksys_mount+0xba/0xe0 fs/namespace.c:3015 __do_sys_mount fs/namespace.c:3029 [inline] __se_sys_mount fs/namespace.c:3026 [inline] __x64_sys_mount+0xb9/0x150 fs/namespace.c:3026 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 ffff8881dbd40900 which belongs to the cache kmalloc-8192 of size 8192 The buggy address is located 3408 bytes inside of 8192-byte region [ffff8881dbd40900, ffff8881dbd42900) The buggy address belongs to the page: page:ffffea00076f5000 count:1 mapcount:0 mapping:ffff8881f6002080 index:0x0 compound_mapcount: 0 flags: 0x17ff00000008100(slab|head) raw: 017ff00000008100 ffffea0007caf308 ffff8881f6001b48 ffff8881f6002080 raw: 0000000000000000 ffff8881dbd40900 0000000100000001 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8881dbd41500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8881dbd41580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8881dbd41600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8881dbd41680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8881dbd41700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================