F2FS-fs (loop4): Can't find valid F2FS filesystem in 1th superblock F2FS-fs (loop4): invalid crc value F2FS-fs (loop4): invalid crc value F2FS-fs (loop4): Failed to get valid F2FS checkpoint ================================================================== BUG: KASAN: slab-use-after-free in destroy_device_list+0x195/0x200 fs/f2fs/super.c:1606 Read of size 4 at addr ffff88808d97577c by task syz-executor.4/7181 CPU: 0 PID: 7181 Comm: syz-executor.4 Not tainted 6.7.0-next-20240112-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 11/17/2023 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd9/0x1b0 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:377 [inline] print_report+0xc3/0x620 mm/kasan/report.c:488 kasan_report+0xd9/0x110 mm/kasan/report.c:601 destroy_device_list+0x195/0x200 fs/f2fs/super.c:1606 kill_f2fs_super+0x2c6/0x440 fs/f2fs/super.c:4932 deactivate_locked_super+0xbe/0x1a0 fs/super.c:477 mount_bdev+0x27e/0x2d0 fs/super.c:1665 legacy_get_tree+0x109/0x220 fs/fs_context.c:662 vfs_get_tree+0x8f/0x380 fs/super.c:1784 do_new_mount fs/namespace.c:3352 [inline] path_mount+0x14e6/0x1f20 fs/namespace.c:3679 do_mount fs/namespace.c:3692 [inline] __do_sys_mount fs/namespace.c:3898 [inline] __se_sys_mount fs/namespace.c:3875 [inline] __x64_sys_mount+0x297/0x320 fs/namespace.c:3875 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xd2/0x260 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x6d/0x75 RIP: 0033:0x7fa06947e4aa Code: d8 64 89 02 48 c7 c0 ff ff ff ff eb a6 e8 de 09 00 00 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 49 89 ca b8 a5 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fa0687feef8 EFLAGS: 00000202 ORIG_RAX: 00000000000000a5 RAX: ffffffffffffffda RBX: 00007fa0687fef80 RCX: 00007fa06947e4aa RDX: 00000000200000c0 RSI: 0000000020010280 RDI: 00007fa0687fef40 RBP: 00000000200000c0 R08: 00007fa0687fef80 R09: 0000000000000010 R10: 0000000000000010 R11: 0000000000000202 R12: 0000000020010280 R13: 00007fa0687fef40 R14: 0000000000007e7b R15: 0000000020007f80 Allocated by task 7181: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 poison_kmalloc_redzone mm/kasan/common.c:372 [inline] __kasan_kmalloc+0xaa/0xb0 mm/kasan/common.c:389 kmalloc include/linux/slab.h:590 [inline] kzalloc include/linux/slab.h:711 [inline] f2fs_fill_super+0xfe/0x8e50 fs/f2fs/super.c:4397 mount_bdev+0x1e3/0x2d0 fs/super.c:1663 legacy_get_tree+0x109/0x220 fs/fs_context.c:662 vfs_get_tree+0x8f/0x380 fs/super.c:1784 do_new_mount fs/namespace.c:3352 [inline] path_mount+0x14e6/0x1f20 fs/namespace.c:3679 do_mount fs/namespace.c:3692 [inline] __do_sys_mount fs/namespace.c:3898 [inline] __se_sys_mount fs/namespace.c:3875 [inline] __x64_sys_mount+0x297/0x320 fs/namespace.c:3875 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xd2/0x260 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x6d/0x75 Freed by task 7181: kasan_save_stack+0x33/0x60 mm/kasan/common.c:47 kasan_save_track+0x14/0x30 mm/kasan/common.c:68 kasan_save_free_info+0x3f/0x60 mm/kasan/generic.c:640 poison_slab_object mm/kasan/common.c:241 [inline] __kasan_slab_free+0x121/0x1c0 mm/kasan/common.c:257 kasan_slab_free include/linux/kasan.h:184 [inline] slab_free_hook mm/slub.c:2121 [inline] slab_free mm/slub.c:4299 [inline] kfree+0x129/0x370 mm/slub.c:4409 f2fs_fill_super+0x270c/0x8e50 fs/f2fs/super.c:4882 mount_bdev+0x1e3/0x2d0 fs/super.c:1663 legacy_get_tree+0x109/0x220 fs/fs_context.c:662 vfs_get_tree+0x8f/0x380 fs/super.c:1784 do_new_mount fs/namespace.c:3352 [inline] path_mount+0x14e6/0x1f20 fs/namespace.c:3679 do_mount fs/namespace.c:3692 [inline] __do_sys_mount fs/namespace.c:3898 [inline] __se_sys_mount fs/namespace.c:3875 [inline] __x64_sys_mount+0x297/0x320 fs/namespace.c:3875 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xd2/0x260 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x6d/0x75 The buggy address belongs to the object at ffff88808d974000 which belongs to the cache kmalloc-8k of size 8192 The buggy address is located 6012 bytes inside of freed 8192-byte region [ffff88808d974000, ffff88808d976000) The buggy address belongs to the physical page: page:ffffea0002365c00 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x8d970 head:ffffea0002365c00 order:3 entire_mapcount:0 nr_pages_mapped:0 pincount:0 anon flags: 0xfff80000000840(slab|head|node=0|zone=1|lastcpupid=0xfff) page_type: 0xffffffff() raw: 00fff80000000840 ffff888014c42280 ffffea000213ee00 0000000000000005 raw: 0000000000000000 0000000080020002 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 3, migratetype Unmovable, gfp_mask 0x1d28c0(GFP_NOWAIT|__GFP_IO|__GFP_FS|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 6239, tgid 6238 (syz-executor.4), ts 354518052302, free_ts 354497202893 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x2d4/0x350 mm/page_alloc.c:1533 prep_new_page mm/page_alloc.c:1540 [inline] get_page_from_freelist+0xa19/0x3740 mm/page_alloc.c:3347 __alloc_pages+0x22e/0x2420 mm/page_alloc.c:4603 __alloc_pages_node include/linux/gfp.h:238 [inline] alloc_pages_node include/linux/gfp.h:261 [inline] alloc_slab_page mm/slub.c:2190 [inline] allocate_slab mm/slub.c:2354 [inline] new_slab+0xcc/0x3a0 mm/slub.c:2407 ___slab_alloc+0x4ab/0x1990 mm/slub.c:3540 __slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3625 __slab_alloc_node mm/slub.c:3678 [inline] slab_alloc_node mm/slub.c:3850 [inline] __do_kmalloc_node mm/slub.c:3980 [inline] __kmalloc_node_track_caller+0x36b/0x470 mm/slub.c:4001 kmalloc_reserve+0xef/0x260 net/core/skbuff.c:582 __alloc_skb+0x12b/0x330 net/core/skbuff.c:651 alloc_skb include/linux/skbuff.h:1296 [inline] netlink_dump+0x2e9/0xcc0 net/netlink/af_netlink.c:2231 netlink_recvmsg+0xa02/0xf20 net/netlink/af_netlink.c:1990 sock_recvmsg_nosec net/socket.c:1046 [inline] ____sys_recvmsg+0x5fe/0x6b0 net/socket.c:2801 ___sys_recvmsg+0x115/0x1a0 net/socket.c:2845 do_recvmmsg+0x2af/0x750 net/socket.c:2939 __sys_recvmmsg net/socket.c:3020 [inline] __do_sys_recvmmsg net/socket.c:3041 [inline] __se_sys_recvmmsg net/socket.c:3034 [inline] __x64_sys_recvmmsg+0x1a6/0x290 net/socket.c:3034 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xd2/0x260 arch/x86/entry/common.c:83 page last free pid 4513 tgid 4513 stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1140 [inline] free_unref_page_prepare+0x527/0xb10 mm/page_alloc.c:2382 free_unref_page+0x33/0x3c0 mm/page_alloc.c:2522 __put_partials+0x14c/0x170 mm/slub.c:2922 qlink_free mm/kasan/quarantine.c:160 [inline] qlist_free_all+0x58/0x150 mm/kasan/quarantine.c:176 kasan_quarantine_reduce+0x192/0x1e0 mm/kasan/quarantine.c:283 __kasan_slab_alloc+0x69/0x90 mm/kasan/common.c:324 kasan_slab_alloc include/linux/kasan.h:201 [inline] slab_post_alloc_hook mm/slub.c:3813 [inline] slab_alloc_node mm/slub.c:3860 [inline] __do_kmalloc_node mm/slub.c:3980 [inline] __kmalloc_node+0x1e9/0x480 mm/slub.c:3988 kmalloc_array_node include/linux/slab.h:688 [inline] kcalloc_node include/linux/slab.h:693 [inline] memcg_alloc_slab_cgroups+0xa9/0x180 mm/memcontrol.c:2990 account_slab mm/slub.c:2317 [inline] allocate_slab mm/slub.c:2372 [inline] new_slab+0x2ed/0x3a0 mm/slub.c:2407 ___slab_alloc+0x4ab/0x1990 mm/slub.c:3540 __slab_alloc.constprop.0+0x56/0xb0 mm/slub.c:3625 __slab_alloc_node mm/slub.c:3678 [inline] slab_alloc_node mm/slub.c:3850 [inline] kmem_cache_alloc+0x2ed/0x320 mm/slub.c:3867 kmem_cache_zalloc include/linux/slab.h:701 [inline] alloc_empty_file+0x73/0x1e0 fs/file_table.c:203 path_openat+0xdb/0x2990 fs/namei.c:3782 do_filp_open+0x1dc/0x430 fs/namei.c:3823 do_sys_openat2+0x17a/0x1e0 fs/open.c:1404 Memory state around the buggy address: ffff88808d975600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88808d975680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88808d975700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88808d975780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88808d975800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================