bisecting fixing commit since a1b977b49b66c75e6c51a515f6700371ae720217 building syzkaller on 6e262c73cd452097096f0b4d5d96f5ae496bc021 testing commit a1b977b49b66c75e6c51a515f6700371ae720217 with gcc (GCC) 8.4.1 20210217 kernel signature: e785428a042e5e425131fc0d4c2607d68963d6c038c6e67244b16650b759ac82 all runs: crashed: KASAN: slab-out-of-bounds Read in f2fs_build_segment_manager testing current HEAD 2034d6f0838e465dd8f120c4e946d8444b4bb5df testing commit 2034d6f0838e465dd8f120c4e946d8444b4bb5df with gcc (GCC) 8.4.1 20210217 kernel signature: 4e256da8c48876e64401bb37433dc8216c69194ac73831f546c8471d6f32e980 all runs: crashed: KASAN: slab-out-of-bounds Read in f2fs_build_segment_manager revisions tested: 2, total time: 24m36.190529629s (build: 17m26.929106861s, test: 6m44.907886786s) the crash still happens on HEAD commit msg: Linux 4.19.184 crash: KASAN: slab-out-of-bounds Read in f2fs_build_segment_manager F2FS-fs (loop5): Fix alignment : done, start(4096) end(147456) block(12288) F2FS-fs (loop5): invalid crc value wlan0: Created IBSS using preconfigured BSSID 50:50:50:50:50:50 wlan0: Creating new IBSS network, BSSID 50:50:50:50:50:50 ================================================================== 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+0x7fdf/0x8f50 fs/f2fs/segment.c:4243 Read of size 8 at addr ffff8881f2c427a8 by task syz-executor.5/7576 CPU: 0 PID: 7576 Comm: syz-executor.5 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_load8_noabort+0x14/0x20 mm/kasan/report.c:433 init_min_max_mtime fs/f2fs/segment.c:4161 [inline] f2fs_build_segment_manager+0x7fdf/0x8f50 fs/f2fs/segment.c:4243 f2fs_fill_super fs/f2fs/super.c:3016 [inline] f2fs_fill_super+0x318d/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:0x466d6a 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:00007fa18c6acfa8 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5 RAX: ffffffffffffffda RBX: 0000000020000140 RCX: 0000000000466d6a RDX: 0000000020000000 RSI: 0000000020000100 RDI: 00007fa18c6ad000 RBP: 00007fa18c6ad040 R08: 00007fa18c6ad040 R09: 0000000020000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000020000000 R13: 0000000020000100 R14: 00007fa18c6ad000 R15: 0000000020000200 Allocated by task 7576: 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+0xc25/0x8f50 fs/f2fs/segment.c:4219 f2fs_fill_super fs/f2fs/super.c:3016 [inline] f2fs_fill_super+0x318d/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 0: (stack is not available) The buggy address belongs to the object at ffff8881f2c42300 which belongs to the cache kmalloc-2048 of size 2048 The buggy address is located 1192 bytes inside of 2048-byte region [ffff8881f2c42300, ffff8881f2c42b00) The buggy address belongs to the page: page:ffffea0007cb1080 count:1 mapcount:0 mapping:ffff8881f6000c40 index:0x0 compound_mapcount: 0 flags: 0x17ffe0000008100(slab|head) raw: 017ffe0000008100 ffffea00074e9d08 ffffea0007c36288 ffff8881f6000c40 raw: 0000000000000000 ffff8881f2c42300 0000000100000003 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8881f2c42680: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff8881f2c42700: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff8881f2c42780: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff8881f2c42800: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8881f2c42880: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ================================================================== wlan0: Created IBSS using preconfigured BSSID 50:50:50:50:50:50 IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready F2FS-fs (loop5): f2fs_check_nid_range: out-of-range nid=1, run fsck to fix. wlan0: Creating new IBSS network, BSSID 50:50:50:50:50:50 IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready F2FS-fs (loop5): f2fs_check_nid_range: out-of-range nid=2, run fsck to fix. IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready F2FS-fs (loop5): inconsistent node block, nid:3, node_footer[nid:0,ino:0,ofs:0,cpver:0,blkaddr:0] IPv6: ADDRCONF(NETDEV_UP): wlan1: link is not ready F2FS-fs (loop5): Failed to read root inode IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready IPv6: ADDRCONF(NETDEV_UP): wlan1: link is not ready F2FS-fs (loop5): Magic Mismatch, valid(0xf2f52010) - read(0x0) IPv6: ADDRCONF(NETDEV_UP): wlan1: link is not ready F2FS-fs (loop5): Can't find valid F2FS filesystem in 1th superblock wlan0: Created IBSS using preconfigured BSSID 50:50:50:50:50:50 wlan1: Created IBSS using preconfigured BSSID 50:50:50:50:50:50 wlan0: Creating new IBSS network, BSSID 50:50:50:50:50:50 wlan0: Created IBSS using preconfigured BSSID 50:50:50:50:50:50 wlan1: Creating new IBSS network, BSSID 50:50:50:50:50:50 wlan0: Creating new IBSS network, BSSID 50:50:50:50:50:50 IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready IPv6: ADDRCONF(NETDEV_CHANGE): wlan1: link becomes ready wlan1: Created IBSS using preconfigured BSSID 50:50:50:50:50:50 IPv6: ADDRCONF(NETDEV_UP): wlan1: link is not ready wlan1: Creating new IBSS network, BSSID 50:50:50:50:50:50 wlan1: Created IBSS using preconfigured BSSID 50:50:50:50:50:50 IPv6: ADDRCONF(NETDEV_CHANGE): wlan1: link becomes ready wlan1: Created IBSS using preconfigured BSSID 50:50:50:50:50:50 wlan1: Creating new IBSS network, BSSID 50:50:50:50:50:50 wlan1: Creating new IBSS network, BSSID 50:50:50:50:50:50 IPv6: ADDRCONF(NETDEV_CHANGE): wlan1: link becomes ready IPv6: ADDRCONF(NETDEV_CHANGE): wlan1: link becomes ready IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready wlan0: Created IBSS using preconfigured BSSID 50:50:50:50:50:50 wlan0: Creating new IBSS network, BSSID 50:50:50:50:50:50 IPv6: ADDRCONF(NETDEV_UP): wlan1: link is not ready IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready wlan1: Created IBSS using preconfigured BSSID 50:50:50:50:50:50 wlan1: Creating new IBSS network, BSSID 50:50:50:50:50:50 IPv6: ADDRCONF(NETDEV_CHANGE): wlan1: link becomes ready f2fs_msg: 851 callbacks suppressed F2FS-fs (loop0): Magic Mismatch, valid(0xf2f52010) - read(0x0) F2FS-fs (loop0): Can't find valid F2FS filesystem in 1th superblock F2FS-fs (loop0): Fix alignment : done, start(4096) end(147456) block(12288) F2FS-fs (loop4): f2fs_check_nid_range: out-of-range nid=1, run fsck to fix. F2FS-fs (loop0): invalid crc value F2FS-fs (loop4): f2fs_check_nid_range: out-of-range nid=2, run fsck to fix. F2FS-fs (loop3): inconsistent node block, nid:3, node_footer[nid:0,ino:0,ofs:0,cpver:0,blkaddr:0] F2FS-fs (loop0): f2fs_check_nid_range: out-of-range nid=1, run fsck to fix. F2FS-fs (loop2): inconsistent node block, nid:3, node_footer[nid:0,ino:0,ofs:0,cpver:0,blkaddr:0] F2FS-fs (loop0): f2fs_check_nid_range: out-of-range nid=2, run fsck to fix. f2fs_msg: 1008 callbacks suppressed F2FS-fs (loop0): f2fs_check_nid_range: out-of-range nid=1, run fsck to fix. F2FS-fs (loop0): f2fs_check_nid_range: out-of-range nid=2, run fsck to fix. F2FS-fs (loop5): f2fs_check_nid_range: out-of-range nid=1, run fsck to fix. F2FS-fs (loop2): Magic Mismatch, valid(0xf2f52010) - read(0x0)