bisecting fixing commit since a1b977b49b66c75e6c51a515f6700371ae720217 building syzkaller on 6e262c73cd452097096f0b4d5d96f5ae496bc021 testing commit a1b977b49b66c75e6c51a515f6700371ae720217 with gcc (GCC) 8.1.0 kernel signature: 0a6f2c630761d604fad5788aa384bd81cfd840799b99b34b74a3750c2944e4ca all runs: crashed: KASAN: slab-out-of-bounds Read in f2fs_build_segment_manager testing current HEAD 4143d798313fffa39f05bf24dd560ace42225c26 testing commit 4143d798313fffa39f05bf24dd560ace42225c26 with gcc (GCC) 8.1.0 kernel signature: ac9bff5b09aba317faa3569dd0adc1bc2acba839ae7fda060f806e4da0ca5822 all runs: crashed: KASAN: slab-out-of-bounds Read in f2fs_build_segment_manager revisions tested: 2, total time: 24m57.248164181s (build: 18m37.396362631s, test: 5m45.591497986s) the crash still happens on HEAD commit msg: Linux 4.19.165 crash: KASAN: slab-out-of-bounds Read in f2fs_build_segment_manager F2FS-fs (loop1): Magic Mismatch, valid(0xf2f52010) - read(0x0) F2FS-fs (loop1): Can't find valid F2FS filesystem in 1th superblock F2FS-fs (loop1): Fix alignment : done, start(4096) end(147456) block(12288) F2FS-fs (loop1): invalid crc value ================================================================== BUG: KASAN: slab-out-of-bounds in init_min_max_mtime fs/f2fs/segment.c:4161 [inline] BUG: KASAN: slab-out-of-bounds in f2fs_build_segment_manager+0x8242/0x8ec0 fs/f2fs/segment.c:4243 Read of size 8 at addr ffff8881d5329968 by task syz-executor.1/7709 CPU: 0 PID: 7709 Comm: syz-executor.1 Not tainted 4.19.165-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_load8_noabort+0x14/0x20 mm/kasan/report.c:433 init_min_max_mtime fs/f2fs/segment.c:4161 [inline] f2fs_build_segment_manager+0x8242/0x8ec0 fs/f2fs/segment.c:4243 f2fs_fill_super+0x318d/0x70c0 fs/f2fs/super.c:3016 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:00007f6adb177a88 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5 RAX: ffffffffffffffda RBX: 00007f6adb177b20 RCX: 00000000004608aa RDX: 0000000020000000 RSI: 0000000020000100 RDI: 00007f6adb177ae0 RBP: 00007f6adb177ae0 R08: 00007f6adb177b20 R09: 0000000020000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000020000000 R13: 0000000020000100 R14: 0000000020000140 R15: 0000000020000200 Allocated by task 7709: 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 __do_kmalloc_node mm/slab.c:3689 [inline] __kmalloc_node+0x50/0x70 mm/slab.c:3696 kmalloc_node include/linux/slab.h:557 [inline] kvmalloc_node+0x68/0x70 mm/util.c:423 kvmalloc include/linux/mm.h:577 [inline] f2fs_kvmalloc fs/f2fs/f2fs.h:2687 [inline] f2fs_kvzalloc fs/f2fs/f2fs.h:2693 [inline] build_sit_info+0x21b/0x2090 fs/f2fs/segment.c:3768 f2fs_build_segment_manager+0xc1f/0x8ec0 fs/f2fs/segment.c:4219 f2fs_fill_super+0x318d/0x70c0 fs/f2fs/super.c:3016 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 0: (stack is not available) The buggy address belongs to the object at ffff8881d53294c0 which belongs to the cache kmalloc-2048 of size 2048 The buggy address is located 1192 bytes inside of 2048-byte region [ffff8881d53294c0, ffff8881d5329cc0) The buggy address belongs to the page: page:ffffea000754ca00 count:1 mapcount:0 mapping:ffff8881f6000c40 index:0x0 compound_mapcount: 0 flags: 0x17ffe0000008100(slab|head) raw: 017ffe0000008100 ffffea0007363088 ffff8881f6001948 ffff8881f6000c40 raw: 0000000000000000 ffff8881d53283c0 0000000100000003 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8881d5329800: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff8881d5329880: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff8881d5329900: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc ^ ffff8881d5329980: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8881d5329a00: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ==================================================================