================================================================== BUG: KASAN: use-after-free in __nf_ct_ext_exist include/net/netfilter/nf_conntrack_extend.h:47 [inline] BUG: KASAN: use-after-free in nf_ct_ext_exist include/net/netfilter/nf_conntrack_extend.h:52 [inline] BUG: KASAN: use-after-free in nf_ct_ecache_exist include/net/netfilter/nf_conntrack_ecache.h:42 [inline] BUG: KASAN: use-after-free in nf_conntrack_confirm include/net/netfilter/nf_conntrack_core.h:63 [inline] BUG: KASAN: use-after-free in nf_confirm+0x575/0x5b0 net/netfilter/nf_conntrack_proto.c:154 Read of size 1 at addr ffff88801a4ab504 by task syz-executor.1/15555 CPU: 1 PID: 15555 Comm: syz-executor.1 Not tainted 5.18.0-syzkaller-04966-g84dc313f7b79 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xcd/0x134 lib/dump_stack.c:106 print_address_description.constprop.0.cold+0xeb/0x495 mm/kasan/report.c:313 print_report mm/kasan/report.c:429 [inline] kasan_report.cold+0xf4/0x1c6 mm/kasan/report.c:491 __nf_ct_ext_exist include/net/netfilter/nf_conntrack_extend.h:47 [inline] nf_ct_ext_exist include/net/netfilter/nf_conntrack_extend.h:52 [inline] nf_ct_ecache_exist include/net/netfilter/nf_conntrack_ecache.h:42 [inline] nf_conntrack_confirm include/net/netfilter/nf_conntrack_core.h:63 [inline] nf_confirm+0x575/0x5b0 net/netfilter/nf_conntrack_proto.c:154 ipv4_confirm+0x17a/0x390 net/netfilter/nf_conntrack_proto.c:182 nf_hook_entry_hookfn include/linux/netfilter.h:142 [inline] nf_hook_slow+0xc5/0x1f0 net/netfilter/core.c:620 nf_hook+0x1cb/0x5b0 include/linux/netfilter.h:262 NF_HOOK_COND include/linux/netfilter.h:295 [inline] ip_output+0x21f/0x310 net/ipv4/ip_output.c:430 dst_output include/net/dst.h:451 [inline] ip_local_out net/ipv4/ip_output.c:126 [inline] ip_send_skb+0xd4/0x260 net/ipv4/ip_output.c:1571 udp_send_skb+0x6c8/0x11a0 net/ipv4/udp.c:967 udp_sendmsg+0x1bee/0x2760 net/ipv4/udp.c:1254 inet_sendmsg+0x99/0xe0 net/ipv4/af_inet.c:819 sock_sendmsg_nosec net/socket.c:714 [inline] sock_sendmsg+0xcf/0x120 net/socket.c:734 rxrpc_send_data_packet+0x1762/0x1e30 net/rxrpc/output.c:451 rxrpc_queue_packet net/rxrpc/sendmsg.c:258 [inline] rxrpc_send_data+0x15c2/0x2e70 net/rxrpc/sendmsg.c:437 rxrpc_do_sendmsg+0xbfe/0x1350 net/rxrpc/sendmsg.c:750 rxrpc_sendmsg+0x429/0x640 net/rxrpc/af_rxrpc.c:561 sock_sendmsg_nosec net/socket.c:714 [inline] sock_sendmsg+0xcf/0x120 net/socket.c:734 ____sys_sendmsg+0x6eb/0x810 net/socket.c:2492 ___sys_sendmsg+0xf3/0x170 net/socket.c:2546 __sys_sendmsg net/socket.c:2575 [inline] __do_sys_sendmsg net/socket.c:2584 [inline] __se_sys_sendmsg net/socket.c:2582 [inline] __x64_sys_sendmsg+0x132/0x220 net/socket.c:2582 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x46/0xb0 RIP: 0033:0x7f80a4c89109 Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007f80a5d23168 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 00007f80a4d9bf60 RCX: 00007f80a4c89109 RDX: 0000000000000548 RSI: 0000000020000000 RDI: 0000000000000004 RBP: 00007f80a4ce308d R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffd4ad1308f R14: 00007f80a5d23300 R15: 0000000000022000 Allocated by task 14896: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38 kasan_set_track mm/kasan/common.c:45 [inline] set_alloc_info mm/kasan/common.c:436 [inline] ____kasan_kmalloc mm/kasan/common.c:515 [inline] ____kasan_kmalloc mm/kasan/common.c:474 [inline] __kasan_kmalloc+0xa9/0xd0 mm/kasan/common.c:524 kmalloc include/linux/slab.h:588 [inline] __hw_addr_create net/core/dev_addr_lists.c:60 [inline] __hw_addr_add_ex+0x22d/0x7e0 net/core/dev_addr_lists.c:118 __hw_addr_add net/core/dev_addr_lists.c:135 [inline] dev_addr_init+0x13a/0x220 net/core/dev_addr_lists.c:558 alloc_netdev_mqs+0x2f4/0x1180 net/core/dev.c:10593 br_add_bridge+0x30/0xf0 net/bridge/br_if.c:450 br_ioctl_stub+0x66d/0x7d0 net/bridge/br_ioctl.c:426 br_ioctl_call+0x5e/0xa0 net/socket.c:1143 sock_ioctl+0x30c/0x640 net/socket.c:1240 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:870 [inline] __se_sys_ioctl fs/ioctl.c:856 [inline] __x64_sys_ioctl+0x193/0x200 fs/ioctl.c:856 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x46/0xb0 Freed by task 15555: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38 kasan_set_track+0x21/0x30 mm/kasan/common.c:45 kasan_set_free_info+0x20/0x30 mm/kasan/generic.c:370 ____kasan_slab_free mm/kasan/common.c:366 [inline] ____kasan_slab_free+0x166/0x1a0 mm/kasan/common.c:328 kasan_slab_free include/linux/kasan.h:200 [inline] slab_free_hook mm/slub.c:1727 [inline] slab_free_freelist_hook+0x8b/0x1c0 mm/slub.c:1753 slab_free mm/slub.c:3507 [inline] kfree+0xd6/0x4d0 mm/slub.c:4555 nf_conntrack_free+0x100/0x630 net/netfilter/nf_conntrack_core.c:1680 nf_ct_destroy+0x1be/0x320 net/netfilter/nf_conntrack_core.c:610 nf_ct_put include/net/netfilter/nf_conntrack.h:184 [inline] nf_ct_put include/net/netfilter/nf_conntrack.h:181 [inline] __nf_ct_resolve_clash+0x624/0x785 net/netfilter/nf_conntrack_core.c:1013 nf_ct_resolve_clash+0x14a/0xa23 net/netfilter/nf_conntrack_core.c:1136 __nf_conntrack_confirm.cold+0x16/0x23e net/netfilter/nf_conntrack_core.c:1284 nf_conntrack_confirm include/net/netfilter/nf_conntrack_core.h:62 [inline] nf_confirm+0x4ce/0x5b0 net/netfilter/nf_conntrack_proto.c:154 ipv4_confirm+0x17a/0x390 net/netfilter/nf_conntrack_proto.c:182 nf_hook_entry_hookfn include/linux/netfilter.h:142 [inline] nf_hook_slow+0xc5/0x1f0 net/netfilter/core.c:620 nf_hook+0x1cb/0x5b0 include/linux/netfilter.h:262 NF_HOOK_COND include/linux/netfilter.h:295 [inline] ip_output+0x21f/0x310 net/ipv4/ip_output.c:430 dst_output include/net/dst.h:451 [inline] ip_local_out net/ipv4/ip_output.c:126 [inline] ip_send_skb+0xd4/0x260 net/ipv4/ip_output.c:1571 udp_send_skb+0x6c8/0x11a0 net/ipv4/udp.c:967 udp_sendmsg+0x1bee/0x2760 net/ipv4/udp.c:1254 inet_sendmsg+0x99/0xe0 net/ipv4/af_inet.c:819 sock_sendmsg_nosec net/socket.c:714 [inline] sock_sendmsg+0xcf/0x120 net/socket.c:734 rxrpc_send_data_packet+0x1762/0x1e30 net/rxrpc/output.c:451 rxrpc_queue_packet net/rxrpc/sendmsg.c:258 [inline] rxrpc_send_data+0x15c2/0x2e70 net/rxrpc/sendmsg.c:437 rxrpc_do_sendmsg+0xbfe/0x1350 net/rxrpc/sendmsg.c:750 rxrpc_sendmsg+0x429/0x640 net/rxrpc/af_rxrpc.c:561 sock_sendmsg_nosec net/socket.c:714 [inline] sock_sendmsg+0xcf/0x120 net/socket.c:734 ____sys_sendmsg+0x6eb/0x810 net/socket.c:2492 ___sys_sendmsg+0xf3/0x170 net/socket.c:2546 __sys_sendmsg net/socket.c:2575 [inline] __do_sys_sendmsg net/socket.c:2584 [inline] __se_sys_sendmsg net/socket.c:2582 [inline] __x64_sys_sendmsg+0x132/0x220 net/socket.c:2582 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x46/0xb0 Last potentially related work creation: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38 __kasan_record_aux_stack+0xbe/0xd0 mm/kasan/generic.c:348 kvfree_call_rcu+0x74/0x990 kernel/rcu/tree.c:3647 __hw_addr_flush+0x152/0x240 net/core/dev_addr_lists.c:490 dev_addr_flush+0x1d/0x50 net/core/dev_addr_lists.c:535 free_netdev+0x1f5/0x620 net/core/dev.c:10698 netdev_run_todo+0xb18/0x10b0 net/core/dev.c:10352 br_ioctl_stub+0x20f/0x7d0 net/bridge/br_ioctl.c:437 br_ioctl_call+0x5e/0xa0 net/socket.c:1143 sock_ioctl+0x30c/0x640 net/socket.c:1240 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:870 [inline] __se_sys_ioctl fs/ioctl.c:856 [inline] __x64_sys_ioctl+0x193/0x200 fs/ioctl.c:856 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x46/0xb0 Second to last potentially related work creation: kasan_save_stack+0x1e/0x40 mm/kasan/common.c:38 __kasan_record_aux_stack+0xbe/0xd0 mm/kasan/generic.c:348 kvfree_call_rcu+0x74/0x990 kernel/rcu/tree.c:3647 __hw_addr_flush+0x152/0x240 net/core/dev_addr_lists.c:490 dev_addr_flush+0x1d/0x50 net/core/dev_addr_lists.c:535 free_netdev+0x1f5/0x620 net/core/dev.c:10698 netdev_run_todo+0xb18/0x10b0 net/core/dev.c:10352 default_device_exit_batch+0x44e/0x590 net/core/dev.c:11329 ops_exit_list+0x125/0x170 net/core/net_namespace.c:167 cleanup_net+0x4ea/0xb00 net/core/net_namespace.c:594 process_one_work+0x996/0x1610 kernel/workqueue.c:2289 worker_thread+0x665/0x1080 kernel/workqueue.c:2436 kthread+0x2e9/0x3a0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:302 The buggy address belongs to the object at ffff88801a4ab500 which belongs to the cache kmalloc-128 of size 128 The buggy address is located 4 bytes inside of 128-byte region [ffff88801a4ab500, ffff88801a4ab580) The buggy address belongs to the physical page: page:ffffea0000692ac0 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1a4ab flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000200 ffffea0001f24700 dead000000000002 ffff888010c418c0 raw: 0000000000000000 0000000080100010 00000001ffffffff 0000000000000000 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 0, migratetype Unmovable, gfp_mask 0x112cc0(GFP_USER|__GFP_NOWARN|__GFP_NORETRY), pid 13041, tgid 13041 (dhcpcd-run-hook), ts 2348398031340, free_ts 2345404955718 prep_new_page mm/page_alloc.c:2441 [inline] get_page_from_freelist+0xba2/0x3e00 mm/page_alloc.c:4182 __alloc_pages+0x1b2/0x500 mm/page_alloc.c:5408 __alloc_pages_node include/linux/gfp.h:587 [inline] alloc_slab_page mm/slub.c:1799 [inline] allocate_slab+0x80/0x3c0 mm/slub.c:1942 new_slab mm/slub.c:2002 [inline] ___slab_alloc+0x985/0xd90 mm/slub.c:3002 __slab_alloc.constprop.0+0x4d/0xa0 mm/slub.c:3089 slab_alloc_node mm/slub.c:3180 [inline] __kmalloc_node+0x2cb/0x390 mm/slub.c:4461 kmalloc_array_node include/linux/slab.h:683 [inline] kcalloc_node include/linux/slab.h:688 [inline] memcg_alloc_slab_cgroups+0x8b/0x140 mm/memcontrol.c:2810 account_slab mm/slab.h:653 [inline] allocate_slab+0x2c9/0x3c0 mm/slub.c:1958 new_slab mm/slub.c:2002 [inline] ___slab_alloc+0x985/0xd90 mm/slub.c:3002 __slab_alloc.constprop.0+0x4d/0xa0 mm/slub.c:3089 slab_alloc_node mm/slub.c:3180 [inline] slab_alloc mm/slub.c:3222 [inline] __kmem_cache_alloc_lru mm/slub.c:3229 [inline] kmem_cache_alloc+0x360/0x3b0 mm/slub.c:3239 vm_area_dup+0x88/0x3f0 kernel/fork.c:467 dup_mmap kernel/fork.c:643 [inline] dup_mm+0x5fa/0x13d0 kernel/fork.c:1526 copy_mm kernel/fork.c:1578 [inline] copy_process+0x3b1c/0x6ff0 kernel/fork.c:2239 kernel_clone+0xe7/0xab0 kernel/fork.c:2644 __do_sys_clone+0xc8/0x110 kernel/fork.c:2761 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1356 [inline] free_pcp_prepare+0x549/0xd20 mm/page_alloc.c:1406 free_unref_page_prepare mm/page_alloc.c:3328 [inline] free_unref_page+0x19/0x6a0 mm/page_alloc.c:3423 kasan_depopulate_vmalloc_pte+0x5c/0x70 mm/kasan/shadow.c:359 apply_to_pte_range mm/memory.c:2547 [inline] apply_to_pmd_range mm/memory.c:2591 [inline] apply_to_pud_range mm/memory.c:2627 [inline] apply_to_p4d_range mm/memory.c:2663 [inline] __apply_to_page_range+0x686/0x1030 mm/memory.c:2697 kasan_release_vmalloc+0xa7/0xc0 mm/kasan/shadow.c:469 __purge_vmap_area_lazy+0x8f9/0x1c50 mm/vmalloc.c:1722 _vm_unmap_aliases.part.0+0x3f0/0x500 mm/vmalloc.c:2127 _vm_unmap_aliases mm/vmalloc.c:2101 [inline] vm_unmap_aliases+0x45/0x50 mm/vmalloc.c:2150 change_page_attr_set_clr+0x241/0x500 arch/x86/mm/pat/set_memory.c:1732 change_page_attr_clear arch/x86/mm/pat/set_memory.c:1789 [inline] set_memory_ro+0x78/0xa0 arch/x86/mm/pat/set_memory.c:1935 alloc_new_pack kernel/bpf/core.c:894 [inline] bpf_prog_pack_alloc kernel/bpf/core.c:928 [inline] bpf_jit_binary_pack_alloc+0x629/0x990 kernel/bpf/core.c:1110 bpf_int_jit_compile+0x53a/0x13e0 arch/x86/net/bpf_jit_comp.c:2421 bpf_prog_select_runtime+0x2da/0x4b0 kernel/bpf/core.c:2223 bpf_migrate_filter+0x2dc/0x380 net/core/filter.c:1295 bpf_prepare_filter net/core/filter.c:1343 [inline] bpf_prog_create_from_user+0x51b/0x660 net/core/filter.c:1437 seccomp_prepare_filter kernel/seccomp.c:671 [inline] seccomp_prepare_user_filter kernel/seccomp.c:708 [inline] seccomp_set_mode_filter kernel/seccomp.c:1871 [inline] do_seccomp+0x3ab/0x2870 kernel/seccomp.c:1991 Memory state around the buggy address: ffff88801a4ab400: 00 00 00 00 00 00 00 00 00 00 00 00 00 fc fc fc ffff88801a4ab480: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88801a4ab500: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88801a4ab580: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88801a4ab600: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc ==================================================================