================================================================== BUG: KASAN: slab-use-after-free in destroy_device_list fs/f2fs/super.c:1606 [inline] BUG: KASAN: slab-use-after-free in kill_f2fs_super+0x618/0x690 fs/f2fs/super.c:4932 Read of size 4 at addr ffff88815264577c by task syz-executor.3/20172 CPU: 1 PID: 20172 Comm: syz-executor.3 Not tainted 6.7.0-syzkaller-09928-g052d534373b7 #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+0x1e7/0x2d0 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:377 [inline] print_report+0x163/0x540 mm/kasan/report.c:488 kasan_report+0x142/0x170 mm/kasan/report.c:601 destroy_device_list fs/f2fs/super.c:1606 [inline] kill_f2fs_super+0x618/0x690 fs/f2fs/super.c:4932 deactivate_locked_super+0xc1/0x130 fs/super.c:477 mount_bdev+0x222/0x2d0 fs/super.c:1665 legacy_get_tree+0xef/0x190 fs/fs_context.c:662 vfs_get_tree+0x8c/0x2a0 fs/super.c:1784 do_new_mount+0x2be/0xb40 fs/namespace.c:3352 do_mount fs/namespace.c:3692 [inline] __do_sys_mount fs/namespace.c:3898 [inline] __se_sys_mount+0x2d9/0x3c0 fs/namespace.c:3875 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf5/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x63/0x6b RIP: 0033:0x7f4ba407e4aa 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:00007f4ba4e40ef8 EFLAGS: 00000202 ORIG_RAX: 00000000000000a5 RAX: ffffffffffffffda RBX: 00007f4ba4e40f80 RCX: 00007f4ba407e4aa RDX: 00000000200000c0 RSI: 0000000020000080 RDI: 00007f4ba4e40f40 RBP: 00000000200000c0 R08: 00007f4ba4e40f80 R09: 0000000002008410 R10: 0000000002008410 R11: 0000000000000202 R12: 0000000020000080 R13: 00007f4ba4e40f40 R14: 000000000000551a R15: 0000000020000380 Allocated by task 20172: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3f/0x70 mm/kasan/common.c:68 poison_kmalloc_redzone mm/kasan/common.c:372 [inline] __kasan_kmalloc+0x98/0xb0 mm/kasan/common.c:389 kasan_kmalloc include/linux/kasan.h:211 [inline] kmalloc_trace+0x1d6/0x360 mm/slub.c:4012 kmalloc include/linux/slab.h:590 [inline] kzalloc include/linux/slab.h:711 [inline] f2fs_fill_super+0xce/0x8170 fs/f2fs/super.c:4397 mount_bdev+0x206/0x2d0 fs/super.c:1663 legacy_get_tree+0xef/0x190 fs/fs_context.c:662 vfs_get_tree+0x8c/0x2a0 fs/super.c:1784 do_new_mount+0x2be/0xb40 fs/namespace.c:3352 do_mount fs/namespace.c:3692 [inline] __do_sys_mount fs/namespace.c:3898 [inline] __se_sys_mount+0x2d9/0x3c0 fs/namespace.c:3875 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf5/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x63/0x6b Freed by task 20172: kasan_save_stack mm/kasan/common.c:47 [inline] kasan_save_track+0x3f/0x70 mm/kasan/common.c:68 kasan_save_free_info+0x4e/0x60 mm/kasan/generic.c:634 poison_slab_object+0xa6/0xe0 mm/kasan/common.c:241 __kasan_slab_free+0x34/0x60 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+0x14a/0x380 mm/slub.c:4409 f2fs_fill_super+0x6b04/0x8170 fs/f2fs/super.c:4882 mount_bdev+0x206/0x2d0 fs/super.c:1663 legacy_get_tree+0xef/0x190 fs/fs_context.c:662 vfs_get_tree+0x8c/0x2a0 fs/super.c:1784 do_new_mount+0x2be/0xb40 fs/namespace.c:3352 do_mount fs/namespace.c:3692 [inline] __do_sys_mount fs/namespace.c:3898 [inline] __se_sys_mount+0x2d9/0x3c0 fs/namespace.c:3875 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf5/0x230 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x63/0x6b The buggy address belongs to the object at ffff888152644000 which belongs to the cache kmalloc-8k of size 8192 The buggy address is located 6012 bytes inside of freed 8192-byte region [ffff888152644000, ffff888152646000) The buggy address belongs to the physical page: page:ffffea0005499000 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x152640 head:ffffea0005499000 order:3 entire_mapcount:0 nr_pages_mapped:0 pincount:0 flags: 0x57ff00000000840(slab|head|node=1|zone=2|lastcpupid=0x7ff) page_type: 0xffffffff() raw: 057ff00000000840 ffff888012c42280 dead000000000122 0000000000000000 raw: 0000000000000000 0000000000020002 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 0x1d20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC|__GFP_HARDWALL), pid 20176, tgid 20175 (syz-executor.4), ts 1728526073261, free_ts 1728522991603 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x1e6/0x210 mm/page_alloc.c:1533 prep_new_page mm/page_alloc.c:1540 [inline] get_page_from_freelist+0x33ea/0x3570 mm/page_alloc.c:3311 __alloc_pages+0x255/0x680 mm/page_alloc.c:4567 __alloc_pages_node include/linux/gfp.h:238 [inline] alloc_pages_node include/linux/gfp.h:261 [inline] alloc_slab_page+0x5f/0x160 mm/slub.c:2190 allocate_slab mm/slub.c:2354 [inline] new_slab+0x84/0x2f0 mm/slub.c:2407 ___slab_alloc+0xd17/0x13d0 mm/slub.c:3540 __slab_alloc mm/slub.c:3625 [inline] __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+0x2cd/0x4e0 mm/slub.c:4001 kmalloc_reserve+0xf3/0x260 net/core/skbuff.c:582 __alloc_skb+0x1b1/0x420 net/core/skbuff.c:651 alloc_skb include/linux/skbuff.h:1296 [inline] nlmsg_new include/net/netlink.h:1010 [inline] nf_tables_gen_notify net/netfilter/nf_tables_api.c:9014 [inline] nf_tables_commit+0x6c3f/0x7e90 net/netfilter/nf_tables_api.c:10300 nfnetlink_rcv_batch net/netfilter/nfnetlink.c:569 [inline] nfnetlink_rcv_skb_batch net/netfilter/nfnetlink.c:639 [inline] nfnetlink_rcv+0x1c09/0x2610 net/netfilter/nfnetlink.c:657 netlink_unicast_kernel net/netlink/af_netlink.c:1341 [inline] netlink_unicast+0x7e6/0x980 net/netlink/af_netlink.c:1367 netlink_sendmsg+0xa37/0xd70 net/netlink/af_netlink.c:1908 sock_sendmsg_nosec net/socket.c:730 [inline] __sock_sendmsg net/socket.c:745 [inline] ____sys_sendmsg+0x592/0x890 net/socket.c:2584 ___sys_sendmsg net/socket.c:2638 [inline] __sys_sendmsg+0x2b0/0x3a0 net/socket.c:2667 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xf5/0x230 arch/x86/entry/common.c:83 page last free pid 5074 tgid 5038 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+0x959/0xa80 mm/page_alloc.c:2346 free_unref_page+0x37/0x3f0 mm/page_alloc.c:2486 napi_frag_unref include/linux/skbuff.h:3460 [inline] skb_release_data+0x446/0x850 net/core/skbuff.c:1022 skb_release_all net/core/skbuff.c:1094 [inline] __kfree_skb+0x57/0x70 net/core/skbuff.c:1108 tcp_clean_rtx_queue net/ipv4/tcp_input.c:3375 [inline] tcp_ack+0x2446/0x6bf0 net/ipv4/tcp_input.c:3967 tcp_rcv_established+0x107f/0x2030 net/ipv4/tcp_input.c:6079 tcp_v4_do_rcv+0x6bd/0xb60 net/ipv4/tcp_ipv4.c:1906 tcp_v4_rcv+0x2cba/0x35c0 net/ipv4/tcp_ipv4.c:2329 ip_protocol_deliver_rcu+0x208/0x3f0 net/ipv4/ip_input.c:205 ip_local_deliver_finish+0x2b6/0x500 net/ipv4/ip_input.c:233 NF_HOOK+0x3a1/0x450 include/linux/netfilter.h:314 dst_input include/net/dst.h:461 [inline] ip_sublist_rcv_finish+0x1b5/0x200 net/ipv4/ip_input.c:580 ip_list_rcv_finish net/ipv4/ip_input.c:631 [inline] ip_sublist_rcv+0x757/0xaa0 net/ipv4/ip_input.c:639 ip_list_rcv+0x42b/0x470 net/ipv4/ip_input.c:674 __netif_receive_skb_list_ptype net/core/dev.c:5577 [inline] __netif_receive_skb_list_core+0x6b5/0x890 net/core/dev.c:5625 __netif_receive_skb_list net/core/dev.c:5677 [inline] netif_receive_skb_list_internal+0xa19/0xe30 net/core/dev.c:5768 Memory state around the buggy address: ffff888152645600: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888152645680: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888152645700: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888152645780: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888152645800: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================