F2FS-fs (loop3): Can't find valid F2FS filesystem in 2th superblock F2FS-fs (loop3): invalid crc_offset: 0 ================================================================== BUG: KASAN: slab-out-of-bounds in build_sit_entries fs/f2fs/segment.c:4234 [inline] BUG: KASAN: slab-out-of-bounds in f2fs_build_segment_manager+0x4bd7/0x8880 fs/f2fs/segment.c:4779 Read of size 4 at addr ffff88817cad70a4 by task syz-executor.3/20068 CPU: 0 PID: 20068 Comm: syz-executor.3 Not tainted 5.4.70-syzkaller-00176-g2a31fdaad927 #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+0x1b0/0x21e lib/dump_stack.c:118 print_address_description+0x96/0x5d0 mm/kasan/report.c:374 __kasan_report+0x14b/0x1c0 mm/kasan/report.c:506 kasan_report+0x27/0x50 mm/kasan/common.c:634 build_sit_entries fs/f2fs/segment.c:4234 [inline] f2fs_build_segment_manager+0x4bd7/0x8880 fs/f2fs/segment.c:4779 f2fs_fill_super+0x691a/0x9a40 fs/f2fs/super.c:3625 mount_bdev+0x22d/0x340 fs/super.c:1417 legacy_get_tree+0xde/0x170 fs/fs_context.c:647 vfs_get_tree+0x85/0x260 fs/super.c:1547 do_new_mount fs/namespace.c:2822 [inline] do_mount+0x1883/0x2630 fs/namespace.c:3142 ksys_mount+0xc2/0xf0 fs/namespace.c:3351 __do_sys_mount fs/namespace.c:3365 [inline] __se_sys_mount fs/namespace.c:3362 [inline] __x64_sys_mount+0xb1/0xc0 fs/namespace.c:3362 do_syscall_64+0xcb/0x150 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x44/0xa9 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:00007f9ce6236a88 EFLAGS: 00000202 ORIG_RAX: 00000000000000a5 RAX: ffffffffffffffda RBX: 00007f9ce6236b20 RCX: 00000000004608aa RDX: 0000000020000000 RSI: 0000000020000100 RDI: 00007f9ce6236ae0 RBP: 00007f9ce6236ae0 R08: 00007f9ce6236b20 R09: 0000000020000000 R10: 0000000000000000 R11: 0000000000000202 R12: 0000000020000000 R13: 0000000020000100 R14: 0000000020000200 R15: 0000000020014900 Allocated by task 20068: save_stack mm/kasan/common.c:69 [inline] set_track mm/kasan/common.c:77 [inline] __kasan_kmalloc+0x117/0x1b0 mm/kasan/common.c:510 __kmalloc+0xf7/0x2c0 mm/slub.c:3863 __kmalloc_node include/linux/slab.h:422 [inline] kmalloc_node include/linux/slab.h:599 [inline] kvmalloc_node+0xc2/0x120 mm/util.c:564 kvmalloc include/linux/mm.h:690 [inline] f2fs_kvmalloc fs/f2fs/f2fs.h:3027 [inline] f2fs_kvzalloc fs/f2fs/f2fs.h:3033 [inline] build_sit_info fs/f2fs/segment.c:4074 [inline] f2fs_build_segment_manager+0x1177/0x8880 fs/f2fs/segment.c:4768 f2fs_fill_super+0x691a/0x9a40 fs/f2fs/super.c:3625 mount_bdev+0x22d/0x340 fs/super.c:1417 legacy_get_tree+0xde/0x170 fs/fs_context.c:647 vfs_get_tree+0x85/0x260 fs/super.c:1547 do_new_mount fs/namespace.c:2822 [inline] do_mount+0x1883/0x2630 fs/namespace.c:3142 ksys_mount+0xc2/0xf0 fs/namespace.c:3351 __do_sys_mount fs/namespace.c:3365 [inline] __se_sys_mount fs/namespace.c:3362 [inline] __x64_sys_mount+0xb1/0xc0 fs/namespace.c:3362 do_syscall_64+0xcb/0x150 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x44/0xa9 Freed by task 2159: save_stack mm/kasan/common.c:69 [inline] set_track mm/kasan/common.c:77 [inline] kasan_set_free_info mm/kasan/common.c:332 [inline] __kasan_slab_free+0x168/0x220 mm/kasan/common.c:471 slab_free_hook mm/slub.c:1453 [inline] slab_free_freelist_hook+0xd0/0x150 mm/slub.c:1486 slab_free mm/slub.c:3051 [inline] kfree+0x12b/0x5d0 mm/slub.c:4017 copy_entries_to_user net/ipv4/netfilter/ip_tables.c:867 [inline] get_entries net/ipv4/netfilter/ip_tables.c:1024 [inline] do_ipt_get_ctl+0x913/0xb40 net/ipv4/netfilter/ip_tables.c:1700 nf_sockopt net/netfilter/nf_sockopt.c:104 [inline] nf_getsockopt+0x2c1/0x2f0 net/netfilter/nf_sockopt.c:122 ip_getsockopt+0x13c/0x230 net/ipv4/ip_sockglue.c:1576 __sys_getsockopt+0x240/0x2b0 net/socket.c:2130 __do_sys_getsockopt net/socket.c:2145 [inline] __se_sys_getsockopt net/socket.c:2142 [inline] __x64_sys_getsockopt+0xb1/0xc0 net/socket.c:2142 do_syscall_64+0xcb/0x150 arch/x86/entry/common.c:290 entry_SYSCALL_64_after_hwframe+0x44/0xa9 The buggy address belongs to the object at ffff88817cad7080 which belongs to the cache kmalloc-64 of size 64 The buggy address is located 36 bytes inside of 64-byte region [ffff88817cad7080, ffff88817cad70c0) The buggy address belongs to the page: page:ffffea0005f2b5c0 refcount:1 mapcount:0 mapping:ffff8881da803180 index:0x0 flags: 0x8000000000000200(slab) raw: 8000000000000200 dead000000000100 dead000000000122 ffff8881da803180 raw: 0000000000000000 0000000080200020 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88817cad6f80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88817cad7000: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc >ffff88817cad7080: 00 00 00 00 04 fc fc fc fc fc fc fc fc fc fc fc ^ ffff88817cad7100: 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc fc ffff88817cad7180: fb fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ================================================================== F2FS-fs (loop3): SIT is corrupted node# 0 vs 7 F2FS-fs (loop3): Failed to initialize F2FS segment manager (-117) F2FS-fs (loop3): Magic Mismatch, valid(0xf2f52010) - read(0x0) F2FS-fs (loop3): Can't find valid F2FS filesystem in 2th superblock F2FS-fs (loop3): invalid crc_offset: 0 F2FS-fs (loop3): SIT is corrupted node# 0 vs 7 F2FS-fs (loop3): Failed to initialize F2FS segment manager (-117)