RSP: 002b:00007f063ba79a88 EFLAGS: 00000202 ORIG_RAX: 00000000000000a5 RAX: ffffffffffffffda RBX: 00007f063ba79b20 RCX: 00000000004607ea RDX: 0000000020000000 RSI: 0000000020000100 RDI: 00007f063ba79ae0 RBP: 00007f063ba79ae0 R08: 00007f063ba79b20 R09: 0000000020000000 R10: 0000000000000000 R11: 0000000000000202 R12: 0000000020000000 R13: 0000000020000100 R14: 0000000020000a40 R15: 0000000020000180 ---[ end trace 55e1b2583f1c2f35 ]--- ================================================================== BUG: KASAN: slab-out-of-bounds in seg_info_from_raw_sit fs/f2fs/segment.h:351 [inline] BUG: KASAN: slab-out-of-bounds in build_sit_entries fs/f2fs/segment.c:4216 [inline] BUG: KASAN: slab-out-of-bounds in f2fs_build_segment_manager+0x45ed/0x8880 fs/f2fs/segment.c:4779 Write of size 64 at addr ffff88817fa2d200 by task syz-executor.2/18336 CPU: 1 PID: 18336 Comm: syz-executor.2 Tainted: G W 5.4.68-syzkaller-00474-g2a7d52383a14 #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 check_memory_region_inline mm/kasan/generic.c:181 [inline] check_memory_region+0x2b5/0x2f0 mm/kasan/generic.c:191 memcpy+0x38/0x50 mm/kasan/common.c:123 seg_info_from_raw_sit fs/f2fs/segment.h:351 [inline] build_sit_entries fs/f2fs/segment.c:4216 [inline] f2fs_build_segment_manager+0x45ed/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:0x4607ea 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:00007f063ba79a88 EFLAGS: 00000202 ORIG_RAX: 00000000000000a5 RAX: ffffffffffffffda RBX: 00007f063ba79b20 RCX: 00000000004607ea RDX: 0000000020000000 RSI: 0000000020000100 RDI: 00007f063ba79ae0 RBP: 00007f063ba79ae0 R08: 00007f063ba79b20 R09: 0000000020000000 R10: 0000000000000000 R11: 0000000000000202 R12: 0000000020000000 R13: 0000000020000100 R14: 0000000020000a40 R15: 0000000020000180 Allocated by task 18336: 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:3848 __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:4046 [inline] f2fs_build_segment_manager+0xe57/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 17715: 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:1443 [inline] slab_free_freelist_hook+0xd0/0x150 mm/slub.c:1476 slab_free mm/slub.c:3041 [inline] kfree+0x12b/0x5d0 mm/slub.c:4002 bpf_check+0xb5bb/0xe710 kernel/bpf/verifier.c:9479 bpf_prog_load kernel/bpf/syscall.c:1723 [inline] __do_sys_bpf+0x82c3/0xbf30 kernel/bpf/syscall.c:2888 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 ffff88817fa2c000 which belongs to the cache kmalloc-8k of size 8192 The buggy address is located 4608 bytes inside of 8192-byte region [ffff88817fa2c000, ffff88817fa2e000) The buggy address belongs to the page: page:ffffea0005fe8a00 refcount:1 mapcount:0 mapping:ffff8881da80c500 index:0x0 compound_mapcount: 0 flags: 0x8000000000010200(slab|head) raw: 8000000000010200 dead000000000100 dead000000000122 ffff8881da80c500 raw: 0000000000000000 0000000080020002 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff88817fa2d100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff88817fa2d180: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff88817fa2d200: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff88817fa2d280: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88817fa2d300: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ================================================================== ------------[ cut here ]------------ WARNING: CPU: 1 PID: 18336 at fs/f2fs/segment.h:657 check_seg_range fs/f2fs/segment.c:4201 [inline] WARNING: CPU: 1 PID: 18336 at fs/f2fs/segment.h:657 current_sit_addr fs/f2fs/segment.h:721 [inline] WARNING: CPU: 1 PID: 18336 at fs/f2fs/segment.h:657 get_current_sit_page fs/f2fs/segment.c:3784 [inline] WARNING: CPU: 1 PID: 18336 at fs/f2fs/segment.h:657 build_sit_entries fs/f2fs/segment.c:4206 [inline] WARNING: CPU: 1 PID: 18336 at fs/f2fs/segment.h:657 f2fs_build_segment_manager+0x4958/0x8880 fs/f2fs/segment.c:4779 Modules linked in: CPU: 1 PID: 18336 Comm: syz-executor.2 Tainted: G B W 5.4.68-syzkaller-00474-g2a7d52383a14 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 RIP: 0010:check_seg_range fs/f2fs/segment.c:4201 [inline] RIP: 0010:current_sit_addr fs/f2fs/segment.h:721 [inline] RIP: 0010:get_current_sit_page fs/f2fs/segment.c:3784 [inline] RIP: 0010:build_sit_entries fs/f2fs/segment.c:4206 [inline] RIP: 0010:f2fs_build_segment_manager+0x4958/0x8880 fs/f2fs/segment.c:4779 Code: c8 00 00 00 45 85 e4 0f 84 b9 02 00 00 48 ff 44 24 10 e8 5b 6a 6f ff 41 ff cc 48 83 44 24 48 28 e9 fa f8 ff ff e8 48 6a 6f ff <0f> 0b 48 8b 9c 24 10 01 00 00 48 89 df be 08 00 00 00 e8 e1 f3 9c RSP: 0018:ffff8881c7fcf700 EFLAGS: 00010246 RAX: ffffffff81d1fef8 RBX: 000000000000001e RCX: 0000000000040000 RDX: ffffc900020d5000 RSI: 000000000003ffff RDI: 0000000000040000 RBP: ffff8881c7fcf910 R08: ffffffff81d1f971 R09: ffff88817fa2d700 R10: ffffed102ff45ae8 R11: 00000000000000fc R12: 0000000000000000 R13: ffff8881c666a15c R14: 000000000000001f R15: 0000000000000600 FS: 00007f063ba7a700(0000) GS:ffff8881db900000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007fd41eb5c000 CR3: 0000000191bdf004 CR4: 00000000001606e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: 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:0x4607ea 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:00007f063ba79a88 EFLAGS: 00000202 ORIG_RAX: 00000000000000a5 RAX: ffffffffffffffda RBX: 00007f063ba79b20 RCX: 00000000004607ea RDX: 0000000020000000 RSI: 0000000020000100 RDI: 00007f063ba79ae0 RBP: 00007f063ba79ae0 R08: 00007f063ba79b20 R09: 0000000020000000 R10: 0000000000000000 R11: 0000000000000202 R12: 0000000020000000 R13: 0000000020000100 R14: 0000000020000a40 R15: 0000000020000180 ---[ end trace 55e1b2583f1c2f36 ]--- F2FS-fs (loop2): Wrong valid blocks 0 or segno 31 F2FS-fs (loop2): Failed to initialize F2FS segment manager (-117)