bisecting fixing commit since 811218eceeaa7618652e1b8d11caeff67ab42072 building syzkaller on 14052202e8d8d0bb407512b6861e9085f9171241 testing commit 811218eceeaa7618652e1b8d11caeff67ab42072 with gcc (GCC) 8.4.1 20210217 kernel signature: 4370385accc9eb68a24ffeea28d6c5d28f793f7cd457ecb8d6be7d940a691388 all runs: crashed: KASAN: use-after-free Read in f2fs_evict_inode testing current HEAD eb575cd5d7f60241d016fdd13a9e86d962093c9b testing commit eb575cd5d7f60241d016fdd13a9e86d962093c9b with gcc (GCC) 8.4.1 20210217 kernel signature: afad157305f8753df695a5df89780043d803a6cc8a2237cd92c16e248b318e24 all runs: crashed: KASAN: use-after-free Read in f2fs_evict_inode revisions tested: 2, total time: 22m25.004985474s (build: 15m10.568812425s, test: 6m53.241824272s) the crash still happens on HEAD commit msg: Linux 4.19.195 crash: KASAN: use-after-free Read in f2fs_evict_inode F2FS-fs (loop2): Can't find valid F2FS filesystem in 2th superblock F2FS-fs (loop5): Cannot turn on quotas: -2 on 1 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 ffff8880a3cc1e10 by task syz-executor.1/12089 CPU: 0 PID: 12089 Comm: syz-executor.1 Not tainted 4.19.195-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:00007fbb1d3b2fa8 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5 RAX: ffffffffffffffda RBX: 0000000020000200 RCX: 00000000004672ba RDX: 0000000020000000 RSI: 0000000020000100 RDI: 00007fbb1d3b3000 RBP: 00007fbb1d3b3040 R08: 00007fbb1d3b3040 R09: 0000000020000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000020000000 R13: 0000000020000100 R14: 00007fbb1d3b3000 R15: 0000000020000300 Allocated by task 12089: 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 12089: 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 ffff8880a3cc10c0 which belongs to the cache kmalloc-8192 of size 8192 The buggy address is located 3408 bytes inside of 8192-byte region [ffff8880a3cc10c0, ffff8880a3cc30c0) The buggy address belongs to the page: page:ffffea00028f3000 count:1 mapcount:0 mapping:ffff88813bff5080 index:0x0 compound_mapcount: 0 flags: 0xfff00000008100(slab|head) raw: 00fff00000008100 ffffea00028f1d08 ffffea00028d9008 ffff88813bff5080 raw: 0000000000000000 ffff8880a3cc10c0 0000000100000001 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8880a3cc1d00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880a3cc1d80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff8880a3cc1e00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff8880a3cc1e80: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff8880a3cc1f00: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================