RBP: 00007fa294c31ae0 R08: 00007fa294c31b20 R09: 0000000020000000 R10: 0000000000000000 R11: 0000000000000202 R12: 0000000020000000 R13: 0000000020000100 R14: 0000000020000200 R15: 0000000020014900 ---[ end trace 187579a8d88204ee ]--- ================================================================== 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 ffff8881a8825200 by task syz-executor.0/6780 CPU: 0 PID: 6780 Comm: syz-executor.0 Tainted: G W 5.4.70-syzkaller-00061-g54d2c66faf42 #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:0x46087a 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:00007fa294c31a88 EFLAGS: 00000202 ORIG_RAX: 00000000000000a5 RAX: ffffffffffffffda RBX: 00007fa294c31b20 RCX: 000000000046087a RDX: 0000000020000000 RSI: 0000000020000100 RDI: 00007fa294c31ae0 RBP: 00007fa294c31ae0 R08: 00007fa294c31b20 R09: 0000000020000000 R10: 0000000000000000 R11: 0000000000000202 R12: 0000000020000000 R13: 0000000020000100 R14: 0000000020000200 R15: 0000000020014900 Allocated by task 6780: 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: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 5171: 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 device_release+0x70/0x1a0 drivers/base/core.c:1760 kobject_cleanup+0x2a5/0x400 lib/kobject.c:708 netdev_run_todo+0xc4b/0xe00 net/core/dev.c:9371 ieee80211_unregister_hw+0x5c/0x230 net/mac80211/main.c:1334 mac80211_hwsim_del_radio+0x2b7/0x4a0 drivers/net/wireless/mac80211_hwsim.c:3136 hwsim_exit_net+0x5d3/0x6c0 drivers/net/wireless/mac80211_hwsim.c:3885 ops_exit_list net/core/net_namespace.c:172 [inline] cleanup_net+0x704/0xd60 net/core/net_namespace.c:597 process_one_work+0x777/0xf90 kernel/workqueue.c:2280 worker_thread+0xa8f/0x1430 kernel/workqueue.c:2426 kthread+0x317/0x340 kernel/kthread.c:268 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:352 The buggy address belongs to the object at ffff8881a8824000 which belongs to the cache kmalloc-8k of size 8192 The buggy address is located 4608 bytes inside of 8192-byte region [ffff8881a8824000, ffff8881a8826000) The buggy address belongs to the page: page:ffffea0006a20800 refcount:1 mapcount:0 mapping:ffff8881da80c500 index:0x0 compound_mapcount: 0 flags: 0x8000000000010200(slab|head) raw: 8000000000010200 ffffea00066afe00 0000000300000003 ffff8881da80c500 raw: 0000000000000000 0000000080020002 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected Memory state around the buggy address: ffff8881a8825100: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffff8881a8825180: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 >ffff8881a8825200: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ^ ffff8881a8825280: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff8881a8825300: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ================================================================== ------------[ cut here ]------------ WARNING: CPU: 0 PID: 6780 at fs/f2fs/segment.h:657 check_seg_range fs/f2fs/segment.c:4201 [inline] WARNING: CPU: 0 PID: 6780 at fs/f2fs/segment.h:657 current_sit_addr fs/f2fs/segment.h:721 [inline] WARNING: CPU: 0 PID: 6780 at fs/f2fs/segment.h:657 get_current_sit_page fs/f2fs/segment.c:3784 [inline] WARNING: CPU: 0 PID: 6780 at fs/f2fs/segment.h:657 build_sit_entries fs/f2fs/segment.c:4206 [inline] WARNING: CPU: 0 PID: 6780 at fs/f2fs/segment.h:657 f2fs_build_segment_manager+0x4958/0x8880 fs/f2fs/segment.c:4779 Modules linked in: CPU: 0 PID: 6780 Comm: syz-executor.0 Tainted: G B W 5.4.70-syzkaller-00061-g54d2c66faf42 #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 8b 5d 6f ff 41 ff cc 48 83 44 24 48 28 e9 fa f8 ff ff e8 78 5d 6f ff <0f> 0b 48 8b 9c 24 10 01 00 00 48 89 df be 08 00 00 00 e8 21 ed 9c RSP: 0018:ffff8881a2a8f700 EFLAGS: 00010246 RAX: ffffffff81d20a38 RBX: 000000000000001e RCX: 0000000000040000 RDX: ffffc90000c37000 RSI: 000000000003ffff RDI: 0000000000040000 RBP: ffff8881a2a8f910 R08: ffffffff81d204b1 R09: ffff8881a8825700 R10: ffffed1035104ae8 R11: 00000000000000fc R12: 0000000000000000 R13: ffff8881cef08d5c R14: 000000000000001f R15: 0000000000000600 FS: 00007fa294c32700(0000) GS:ffff8881db800000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f2124f88028 CR3: 0000000152c84005 CR4: 00000000001606f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000600 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:0x46087a 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:00007fa294c31a88 EFLAGS: 00000202 ORIG_RAX: 00000000000000a5 RAX: ffffffffffffffda RBX: 00007fa294c31b20 RCX: 000000000046087a RDX: 0000000020000000 RSI: 0000000020000100 RDI: 00007fa294c31ae0 RBP: 00007fa294c31ae0 R08: 00007fa294c31b20 R09: 0000000020000000 R10: 0000000000000000 R11: 0000000000000202 R12: 0000000020000000 R13: 0000000020000100 R14: 0000000020000200 R15: 0000000020014900 ---[ end trace 187579a8d88204ef ]--- F2FS-fs (loop0): Wrong valid blocks 0 or segno 31 F2FS-fs (loop0): Failed to initialize F2FS segment manager (-117)