bisecting fixing commit since 811218eceeaa7618652e1b8d11caeff67ab42072 building syzkaller on 14052202e8d8d0bb407512b6861e9085f9171241 testing commit 811218eceeaa7618652e1b8d11caeff67ab42072 with gcc (GCC) 8.4.1 20210217 kernel signature: 4e0b3aac90d213f15c694427b7e62f37c16b56661bfb4a10a5c86717398916b0 all runs: crashed: KASAN: use-after-free Read in f2fs_evict_inode testing current HEAD 97a8651cadce7c2b7c4d8f108b392eff31fe2c08 testing commit 97a8651cadce7c2b7c4d8f108b392eff31fe2c08 with gcc (GCC) 8.4.1 20210217 kernel signature: f5de5982a90df519d15647d0cdb70cbddcf68b7bb5d84a30957225eb11c7b00a all runs: crashed: KASAN: use-after-free Read in f2fs_evict_inode revisions tested: 2, total time: 21m55.48277273s (build: 14m20.402729997s, test: 7m15.12373487s) the crash still happens on HEAD commit msg: Linux 4.19.189 crash: KASAN: use-after-free Read in f2fs_evict_inode F2FS-fs (loop2): Try to recover 2th superblock, ret: 0 F2FS-fs (loop2): Mounted with checkpoint version = 1e177019 ieee802154 phy0 wpan0: encryption failed: -22 ieee802154 phy1 wpan1: encryption failed: -22 ================================================================== BUG: KASAN: use-after-free in f2fs_evict_inode+0xd4e/0x1000 fs/f2fs/inode.c:650 Read of size 4 at addr ffff88809baba810 by task syz-executor.0/12385 CPU: 1 PID: 12385 Comm: syz-executor.0 Not tainted 4.19.189-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 f2fs_msg: 489 callbacks suppressed F2FS-fs (loop2): Cannot turn on quotas: -2 on 1 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:00007effb7e7bfa8 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5 RAX: ffffffffffffffda RBX: 0000000020000200 RCX: 00000000004672ba RDX: 0000000020000000 RSI: 0000000020000100 RDI: 00007effb7e7c000 RBP: 00007effb7e7c040 R08: 00007effb7e7c040 R09: 0000000020000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000020000000 R13: 0000000020000100 R14: 00007effb7e7c000 R15: 0000000020000300 Allocated by task 12385: 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 12385: 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 ffff88809bab9ac0 which belongs to the cache kmalloc-8192 of size 8192 The buggy address is located 3408 bytes inside of 8192-byte region [ffff88809bab9ac0, ffff88809babbac0) The buggy address belongs to the page: page:ffffea00026eae00 count:1 mapcount:0 mapping:ffff88813bff5080 index:0x0 compound_mapcount: 0 flags: 0xfff00000008100(slab|head) raw: 00fff00000008100 ffffea0002717208 ffffea00026eea08 ffff88813bff5080 raw: 0000000000000000 ffff88809bab9ac0 0000000100000001 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88809baba700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88809baba780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88809baba800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88809baba880: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88809baba900: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================