================================================================== BUG: KASAN: use-after-free in hlist_add_head_rcu include/linux/rculist.h:593 [inline] BUG: KASAN: use-after-free in nf_nat_setup_info+0x1bb1/0x28d0 net/netfilter/nf_nat_core.c:633 Write of size 8 at addr ffff88805aa114d8 by task ksoftirqd/1/21 CPU: 1 PID: 21 Comm: ksoftirqd/1 Not tainted 6.1.115-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x1e3/0x2cb lib/dump_stack.c:106 print_address_description mm/kasan/report.c:284 [inline] print_report+0x15f/0x4f0 mm/kasan/report.c:395 kasan_report+0x136/0x160 mm/kasan/report.c:495 hlist_add_head_rcu include/linux/rculist.h:593 [inline] nf_nat_setup_info+0x1bb1/0x28d0 net/netfilter/nf_nat_core.c:633 __nf_nat_alloc_null_binding net/netfilter/nf_nat_core.c:664 [inline] nf_nat_alloc_null_binding net/netfilter/nf_nat_core.c:670 [inline] nf_nat_inet_fn+0x9d1/0xce0 net/netfilter/nf_nat_core.c:759 nf_nat_ipv4_fn net/netfilter/nf_nat_proto.c:645 [inline] nf_nat_ipv4_local_in+0x227/0x5a0 net/netfilter/nf_nat_proto.c:708 nf_hook_entry_hookfn include/linux/netfilter.h:142 [inline] nf_hook_slow+0xae/0x1e0 net/netfilter/core.c:614 nf_hook include/linux/netfilter.h:257 [inline] NF_HOOK+0x29a/0x450 include/linux/netfilter.h:300 NF_HOOK+0x39d/0x450 include/linux/netfilter.h:302 __netif_receive_skb_one_core net/core/dev.c:5532 [inline] __netif_receive_skb+0x1c6/0x530 net/core/dev.c:5646 process_backlog+0x381/0x760 net/core/dev.c:5974 __napi_poll+0xc7/0x470 net/core/dev.c:6541 napi_poll net/core/dev.c:6608 [inline] net_rx_action+0x70f/0xeb0 net/core/dev.c:6722 handle_softirqs+0x2ee/0xa40 kernel/softirq.c:571 run_ksoftirqd+0xc6/0x120 kernel/softirq.c:938 smpboot_thread_fn+0x52c/0xa30 kernel/smpboot.c:164 kthread+0x28d/0x320 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 Allocated by task 21: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4b/0x70 mm/kasan/common.c:52 ____kasan_kmalloc mm/kasan/common.c:374 [inline] __kasan_kmalloc+0x97/0xb0 mm/kasan/common.c:383 kmalloc include/linux/slab.h:557 [inline] kzalloc include/linux/slab.h:693 [inline] nf_ct_tmpl_alloc+0x7a/0x220 net/netfilter/nf_conntrack_core.c:550 nft_ct_set_zone_eval+0x3b9/0x5c0 net/netfilter/nft_ct.c:270 expr_call_ops_eval net/netfilter/nf_tables_core.c:214 [inline] nft_do_chain+0x4ee/0x1b70 net/netfilter/nf_tables_core.c:264 nft_do_chain_ipv4+0x1f7/0x310 net/netfilter/nft_chain_filter.c:23 nf_hook_entry_hookfn include/linux/netfilter.h:142 [inline] nf_hook_slow+0xae/0x1e0 net/netfilter/core.c:614 nf_hook include/linux/netfilter.h:257 [inline] NF_HOOK+0x29a/0x450 include/linux/netfilter.h:300 __netif_receive_skb_one_core net/core/dev.c:5532 [inline] __netif_receive_skb+0x1c6/0x530 net/core/dev.c:5646 process_backlog+0x381/0x760 net/core/dev.c:5974 __napi_poll+0xc7/0x470 net/core/dev.c:6541 napi_poll net/core/dev.c:6608 [inline] net_rx_action+0x70f/0xeb0 net/core/dev.c:6722 handle_softirqs+0x2ee/0xa40 kernel/softirq.c:571 run_ksoftirqd+0xc6/0x120 kernel/softirq.c:938 smpboot_thread_fn+0x52c/0xa30 kernel/smpboot.c:164 kthread+0x28d/0x320 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 Freed by task 21: kasan_save_stack mm/kasan/common.c:45 [inline] kasan_set_track+0x4b/0x70 mm/kasan/common.c:52 kasan_save_free_info+0x27/0x40 mm/kasan/generic.c:516 ____kasan_slab_free+0xd6/0x120 mm/kasan/common.c:236 kasan_slab_free include/linux/kasan.h:177 [inline] slab_free_hook mm/slub.c:1724 [inline] slab_free_freelist_hook mm/slub.c:1750 [inline] slab_free mm/slub.c:3661 [inline] __kmem_cache_free+0x25c/0x3c0 mm/slub.c:3674 nf_conntrack_destroy+0x121/0x2c0 net/netfilter/core.c:703 nf_conntrack_put include/linux/netfilter/nf_conntrack_common.h:37 [inline] skb_release_head_state+0x165/0x230 net/core/skbuff.c:846 skb_release_all net/core/skbuff.c:854 [inline] __kfree_skb net/core/skbuff.c:870 [inline] kfree_skb_reason+0x13d/0x390 net/core/skbuff.c:893 nf_hook_slow+0x173/0x1e0 net/netfilter/core.c:619 nf_hook include/linux/netfilter.h:257 [inline] NF_HOOK+0x29a/0x450 include/linux/netfilter.h:300 NF_HOOK+0x39d/0x450 include/linux/netfilter.h:302 __netif_receive_skb_one_core net/core/dev.c:5532 [inline] __netif_receive_skb+0x1c6/0x530 net/core/dev.c:5646 process_backlog+0x381/0x760 net/core/dev.c:5974 __napi_poll+0xc7/0x470 net/core/dev.c:6541 napi_poll net/core/dev.c:6608 [inline] net_rx_action+0x70f/0xeb0 net/core/dev.c:6722 handle_softirqs+0x2ee/0xa40 kernel/softirq.c:571 run_ksoftirqd+0xc6/0x120 kernel/softirq.c:938 smpboot_thread_fn+0x52c/0xa30 kernel/smpboot.c:164 kthread+0x28d/0x320 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 The buggy address belongs to the object at ffff88805aa11400 which belongs to the cache kmalloc-512 of size 512 The buggy address is located 216 bytes inside of 512-byte region [ffff88805aa11400, ffff88805aa11600) The buggy address belongs to the physical page: page:ffffea00016a8400 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x5aa10 head:ffffea00016a8400 order:2 compound_mapcount:0 compound_pincount:0 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 0000000000000000 dead000000000001 ffff888017c41c80 raw: 0000000000000000 0000000000100010 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 2, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 4254, tgid 4254 (syz-executor), ts 74434076221, free_ts 20129758616 set_page_owner include/linux/page_owner.h:31 [inline] post_alloc_hook+0x18d/0x1b0 mm/page_alloc.c:2517 prep_new_page mm/page_alloc.c:2524 [inline] get_page_from_freelist+0x322e/0x33b0 mm/page_alloc.c:4290 __alloc_pages+0x28d/0x770 mm/page_alloc.c:5558 alloc_slab_page+0x6a/0x150 mm/slub.c:1794 allocate_slab mm/slub.c:1939 [inline] new_slab+0x84/0x2d0 mm/slub.c:1992 ___slab_alloc+0xc20/0x1270 mm/slub.c:3180 __slab_alloc mm/slub.c:3279 [inline] slab_alloc_node mm/slub.c:3364 [inline] __kmem_cache_alloc_node+0x19f/0x260 mm/slub.c:3437 __do_kmalloc_node mm/slab_common.c:935 [inline] __kmalloc_node_track_caller+0xa0/0x220 mm/slab_common.c:956 kmalloc_reserve net/core/skbuff.c:446 [inline] __alloc_skb+0x135/0x670 net/core/skbuff.c:515 alloc_skb include/linux/skbuff.h:1271 [inline] nlmsg_new include/net/netlink.h:991 [inline] inet6_netconf_notify_devconf+0xf8/0x1b0 net/ipv6/addrconf.c:582 __addrconf_sysctl_register+0x380/0x3e0 net/ipv6/addrconf.c:7131 addrconf_sysctl_register+0x128/0x180 net/ipv6/addrconf.c:7168 ipv6_add_dev+0xb8e/0x1180 net/ipv6/addrconf.c:451 addrconf_notify+0x7a6/0xf60 net/ipv6/addrconf.c:3579 notifier_call_chain kernel/notifier.c:87 [inline] raw_notifier_call_chain+0xd0/0x170 kernel/notifier.c:455 call_netdevice_notifiers_info net/core/dev.c:1970 [inline] call_netdevice_notifiers_extack net/core/dev.c:2008 [inline] call_netdevice_notifiers+0x145/0x1b0 net/core/dev.c:2022 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1444 [inline] free_pcp_prepare mm/page_alloc.c:1494 [inline] free_unref_page_prepare+0xf63/0x1120 mm/page_alloc.c:3369 free_unref_page+0x33/0x3e0 mm/page_alloc.c:3464 free_contig_range+0x9a/0x150 mm/page_alloc.c:9518 destroy_args+0xfe/0x997 mm/debug_vm_pgtable.c:1031 debug_vm_pgtable+0x416/0x46b mm/debug_vm_pgtable.c:1354 do_one_initcall+0x265/0x8f0 init/main.c:1298 do_initcall_level+0x157/0x207 init/main.c:1371 do_initcalls+0x49/0x86 init/main.c:1387 kernel_init_freeable+0x45c/0x60f init/main.c:1626 kernel_init+0x19/0x290 init/main.c:1514 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 Memory state around the buggy address: ffff88805aa11380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88805aa11400: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff88805aa11480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88805aa11500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88805aa11580: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================