bisecting fixing commit since 811218eceeaa7618652e1b8d11caeff67ab42072 building syzkaller on 14052202e8d8d0bb407512b6861e9085f9171241 testing commit 811218eceeaa7618652e1b8d11caeff67ab42072 with gcc (GCC) 8.4.1 20210217 kernel signature: ed714a38e143c982cb1b0130e1c71856f2ccd7a3ecf0f0daccde28601de3e071 all runs: crashed: KASAN: use-after-free Read in f2fs_evict_inode testing current HEAD 2034d6f0838e465dd8f120c4e946d8444b4bb5df testing commit 2034d6f0838e465dd8f120c4e946d8444b4bb5df with gcc (GCC) 8.4.1 20210217 kernel signature: 6fc3b125edd3d1422810be001326ff376fba2241b2e8530b6578aec1072e0653 all runs: crashed: KASAN: use-after-free Read in f2fs_evict_inode revisions tested: 2, total time: 23m8.26016829s (build: 15m10.197221397s, test: 7m35.295825048s) the crash still happens on HEAD commit msg: Linux 4.19.184 crash: KASAN: use-after-free Read in f2fs_evict_inode F2FS-fs (loop3): Try to recover 2th superblock, ret: 0 F2FS-fs (loop3): Mounted with checkpoint version = 1e177019 F2FS-fs (loop0): Cannot turn on quotas: -2 on 1 F2FS-fs (loop0): Try to recover 2th superblock, ret: 0 ================================================================== BUG: KASAN: use-after-free in f2fs_evict_inode+0xd4e/0x1000 fs/f2fs/inode.c:650 Read of size 4 at addr ffff888092e42450 by task syz-executor.2/12077 CPU: 0 PID: 12077 Comm: syz-executor.2 Not tainted 4.19.184-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:2469 [inline] do_mount+0x376/0x2710 fs/namespace.c:2799 ksys_mount+0xb1/0xd0 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: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:00007f169a2ddfa8 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5 RAX: ffffffffffffffda RBX: 0000000020000200 RCX: 00000000004672ba RDX: 0000000020000000 RSI: 0000000020000100 RDI: 00007f169a2de000 RBP: 00007f169a2de040 R08: 00007f169a2de040 R09: 0000000020000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000020000000 R13: 0000000020000100 R14: 00007f169a2de000 R15: 0000000020000300 Allocated by task 12077: 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:2469 [inline] do_mount+0x376/0x2710 fs/namespace.c:2799 ksys_mount+0xb1/0xd0 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 12077: 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:2469 [inline] do_mount+0x376/0x2710 fs/namespace.c:2799 ksys_mount+0xb1/0xd0 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 ffff888092e41700 which belongs to the cache kmalloc-8192 of size 8192 The buggy address is located 3408 bytes inside of 8192-byte region [ffff888092e41700, ffff888092e43700) The buggy address belongs to the page: page:ffffea00024b9000 count:1 mapcount:0 mapping:ffff88813bff5080 index:0x0 compound_mapcount: 0 flags: 0xfff00000008100(slab|head) raw: 00fff00000008100 ffffea00024b9208 ffffea0002a7f108 ffff88813bff5080 raw: 0000000000000000 ffff888092e41700 0000000100000001 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff888092e42300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888092e42380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888092e42400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888092e42480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888092e42500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================