================================================================== BUG: KASAN: use-after-free in __nf_ct_ext_exist include/net/netfilter/nf_conntrack_extend.h:57 [inline] BUG: KASAN: use-after-free in nf_ct_ext_exist include/net/netfilter/nf_conntrack_extend.h:62 [inline] BUG: KASAN: use-after-free in __nf_ct_ext_find include/net/netfilter/nf_conntrack_extend.h:67 [inline] BUG: KASAN: use-after-free in nf_ct_ecache_find include/net/netfilter/nf_conntrack_ecache.h:33 [inline] BUG: KASAN: use-after-free in nf_ct_deliver_cached_events+0x1e0/0x210 net/netfilter/nf_conntrack_ecache.c:213 Read of size 1 at addr ffff88806db27004 by task syz-executor.0/4322 CPU: 1 PID: 4322 Comm: syz-executor.0 Not tainted 5.18.0-rc2-syzkaller #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+0x57/0x7d 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:57 [inline] nf_ct_ext_exist include/net/netfilter/nf_conntrack_extend.h:62 [inline] __nf_ct_ext_find include/net/netfilter/nf_conntrack_extend.h:67 [inline] nf_ct_ecache_find include/net/netfilter/nf_conntrack_ecache.h:33 [inline] nf_ct_deliver_cached_events+0x1e0/0x210 net/netfilter/nf_conntrack_ecache.c:213 nf_conntrack_confirm include/net/netfilter/nf_conntrack_core.h:64 [inline] nf_confirm+0x2ad/0x390 net/netfilter/nf_conntrack_proto.c:154 nf_hook_entry_hookfn include/linux/netfilter.h:142 [inline] nf_hook_slow+0xaf/0x160 net/netfilter/core.c:620 nf_hook+0x186/0x490 include/linux/netfilter.h:262 NF_HOOK_COND include/linux/netfilter.h:295 [inline] ip_output+0x1c0/0x2a0 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+0x9f/0x1c0 net/ipv4/ip_output.c:1571 udp_send_skb+0x927/0x1460 net/ipv4/udp.c:967 udp_sendmsg+0x16f7/0x2040 net/ipv4/udp.c:1254 sock_sendmsg_nosec net/socket.c:705 [inline] sock_sendmsg+0xab/0xe0 net/socket.c:725 rxrpc_send_abort_packet+0x419/0x6a0 net/rxrpc/output.c:330 rxrpc_release_calls_on_socket+0x1d7/0x2f0 net/rxrpc/call_object.c:606 rxrpc_release_sock net/rxrpc/af_rxrpc.c:886 [inline] rxrpc_release+0x23a/0x530 net/rxrpc/af_rxrpc.c:917 __sock_release+0xbb/0x270 net/socket.c:650 sock_close+0xf/0x20 net/socket.c:1318 __fput+0x1f5/0x8c0 fs/file_table.c:317 task_work_run+0xc0/0x160 kernel/task_work.c:164 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline] exit_to_user_mode_loop kernel/entry/common.c:169 [inline] exit_to_user_mode_prepare+0x23c/0x250 kernel/entry/common.c:201 __syscall_exit_to_user_mode_work kernel/entry/common.c:283 [inline] syscall_exit_to_user_mode+0x19/0x60 kernel/entry/common.c:294 do_syscall_64+0x42/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x44/0xae RIP: 0033:0x7efe9de3bd2b Code: 0f 05 48 3d 00 f0 ff ff 77 45 c3 0f 1f 40 00 48 83 ec 18 89 7c 24 0c e8 63 fc ff ff 8b 7c 24 0c 41 89 c0 b8 03 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 35 44 89 c7 89 44 24 0c e8 a1 fc ff ff 8b 44 RSP: 002b:00007fffa1639730 EFLAGS: 00000293 ORIG_RAX: 0000000000000003 RAX: 0000000000000000 RBX: 0000000000000006 RCX: 00007efe9de3bd2b RDX: 00007efe9dfa0e28 RSI: ffffffffffffffff RDI: 0000000000000005 RBP: 00007efe9df9d960 R08: 0000000000000000 R09: 00007efe9dfa0e30 R10: 00007fffa1639830 R11: 0000000000000293 R12: 0000000000013ece R13: 00007fffa1639830 R14: 00007efe9df9bf60 R15: 0000000000000032 Allocated by task 4322: 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_krealloc+0x10e/0x190 mm/kasan/common.c:583 kasan_krealloc include/linux/kasan.h:254 [inline] __do_krealloc mm/slab_common.c:1180 [inline] krealloc+0x54/0xf0 mm/slab_common.c:1217 nf_ct_ext_add+0x167/0x3a0 net/netfilter/nf_conntrack_extend.c:115 nf_ct_ecache_ext_add include/net/netfilter/nf_conntrack_ecache.h:53 [inline] init_conntrack.constprop.0+0x4ea/0x1190 net/netfilter/nf_conntrack_core.c:1717 resolve_normal_ct net/netfilter/nf_conntrack_core.c:1807 [inline] nf_conntrack_in+0xc2b/0x1370 net/netfilter/nf_conntrack_core.c:1962 nf_hook_entry_hookfn include/linux/netfilter.h:142 [inline] nf_hook_slow+0xaf/0x160 net/netfilter/core.c:620 nf_hook+0x186/0x490 include/linux/netfilter.h:262 __ip_local_out+0x20f/0x450 net/ipv4/ip_output.c:115 ip_local_out net/ipv4/ip_output.c:124 [inline] ip_send_skb+0x42/0x1c0 net/ipv4/ip_output.c:1571 udp_send_skb+0x927/0x1460 net/ipv4/udp.c:967 udp_sendmsg+0x16f7/0x2040 net/ipv4/udp.c:1254 sock_sendmsg_nosec net/socket.c:705 [inline] sock_sendmsg+0xab/0xe0 net/socket.c:725 rxrpc_send_abort_packet+0x419/0x6a0 net/rxrpc/output.c:330 rxrpc_release_calls_on_socket+0x1d7/0x2f0 net/rxrpc/call_object.c:606 rxrpc_release_sock net/rxrpc/af_rxrpc.c:886 [inline] rxrpc_release+0x23a/0x530 net/rxrpc/af_rxrpc.c:917 __sock_release+0xbb/0x270 net/socket.c:650 sock_close+0xf/0x20 net/socket.c:1318 __fput+0x1f5/0x8c0 fs/file_table.c:317 task_work_run+0xc0/0x160 kernel/task_work.c:164 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline] exit_to_user_mode_loop kernel/entry/common.c:169 [inline] exit_to_user_mode_prepare+0x23c/0x250 kernel/entry/common.c:201 __syscall_exit_to_user_mode_work kernel/entry/common.c:283 [inline] syscall_exit_to_user_mode+0x19/0x60 kernel/entry/common.c:294 do_syscall_64+0x42/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x44/0xae Freed by task 4322: 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:1728 [inline] slab_free_freelist_hook+0x8b/0x1c0 mm/slub.c:1754 slab_free mm/slub.c:3510 [inline] kfree+0xd6/0x4d0 mm/slub.c:4552 nf_conntrack_free+0xcf/0x480 net/netfilter/nf_conntrack_core.c:1662 nf_ct_put include/net/netfilter/nf_conntrack.h:185 [inline] nf_ct_put include/net/netfilter/nf_conntrack.h:182 [inline] __nf_ct_resolve_clash+0x424/0x53b net/netfilter/nf_conntrack_core.c:1009 nf_ct_resolve_clash+0x136/0x8c3 net/netfilter/nf_conntrack_core.c:1132 __nf_conntrack_confirm.cold+0x11/0x23d net/netfilter/nf_conntrack_core.c:1266 nf_conntrack_confirm include/net/netfilter/nf_conntrack_core.h:62 [inline] nf_confirm+0x301/0x390 net/netfilter/nf_conntrack_proto.c:154 nf_hook_entry_hookfn include/linux/netfilter.h:142 [inline] nf_hook_slow+0xaf/0x160 net/netfilter/core.c:620 nf_hook+0x186/0x490 include/linux/netfilter.h:262 NF_HOOK_COND include/linux/netfilter.h:295 [inline] ip_output+0x1c0/0x2a0 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+0x9f/0x1c0 net/ipv4/ip_output.c:1571 udp_send_skb+0x927/0x1460 net/ipv4/udp.c:967 udp_sendmsg+0x16f7/0x2040 net/ipv4/udp.c:1254 sock_sendmsg_nosec net/socket.c:705 [inline] sock_sendmsg+0xab/0xe0 net/socket.c:725 rxrpc_send_abort_packet+0x419/0x6a0 net/rxrpc/output.c:330 rxrpc_release_calls_on_socket+0x1d7/0x2f0 net/rxrpc/call_object.c:606 rxrpc_release_sock net/rxrpc/af_rxrpc.c:886 [inline] rxrpc_release+0x23a/0x530 net/rxrpc/af_rxrpc.c:917 __sock_release+0xbb/0x270 net/socket.c:650 sock_close+0xf/0x20 net/socket.c:1318 __fput+0x1f5/0x8c0 fs/file_table.c:317 task_work_run+0xc0/0x160 kernel/task_work.c:164 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline] exit_to_user_mode_loop kernel/entry/common.c:169 [inline] exit_to_user_mode_prepare+0x23c/0x250 kernel/entry/common.c:201 __syscall_exit_to_user_mode_work kernel/entry/common.c:283 [inline] syscall_exit_to_user_mode+0x19/0x60 kernel/entry/common.c:294 do_syscall_64+0x42/0xb0 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x44/0xae The buggy address belongs to the object at ffff88806db27000 which belongs to the cache kmalloc-128 of size 128 The buggy address is located 4 bytes inside of 128-byte region [ffff88806db27000, ffff88806db27080) The buggy address belongs to the physical page: page:ffffea0001b6c9c0 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x6db27 flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000200 ffffea0001c4fb40 dead000000000003 ffff8880100418c0 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 3704, tgid 3704 (dhcpcd-run-hook), ts 47898811933, free_ts 47895117148 prep_new_page mm/page_alloc.c:2441 [inline] get_page_from_freelist+0x178d/0x3dc0 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:1801 [inline] allocate_slab+0x80/0x3c0 mm/slub.c:1944 new_slab mm/slub.c:2004 [inline] ___slab_alloc+0x8e1/0xf20 mm/slub.c:3005 __slab_alloc.constprop.0+0x4d/0xa0 mm/slub.c:3092 slab_alloc_node mm/slub.c:3183 [inline] __kmalloc_node+0x2cb/0x390 mm/slub.c:4458 kmalloc_array_node include/linux/slab.h:676 [inline] kcalloc_node include/linux/slab.h:681 [inline] memcg_alloc_slab_cgroups+0x8b/0x140 mm/memcontrol.c:2800 account_slab mm/slab.h:652 [inline] allocate_slab+0x2c9/0x3c0 mm/slub.c:1960 new_slab mm/slub.c:2004 [inline] ___slab_alloc+0x8e1/0xf20 mm/slub.c:3005 __slab_alloc.constprop.0+0x4d/0xa0 mm/slub.c:3092 slab_alloc_node mm/slub.c:3183 [inline] slab_alloc mm/slub.c:3225 [inline] __kmem_cache_alloc_lru mm/slub.c:3232 [inline] kmem_cache_alloc+0x360/0x3b0 mm/slub.c:3242 vm_area_dup+0x83/0x380 kernel/fork.c:467 dup_mmap kernel/fork.c:643 [inline] dup_mm+0x4da/0x10c0 kernel/fork.c:1521 copy_mm kernel/fork.c:1573 [inline] copy_process+0x602d/0x68e0 kernel/fork.c:2234 kernel_clone+0xb8/0x7f0 kernel/fork.c:2639 __do_sys_clone+0xaf/0xf0 kernel/fork.c:2756 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_list+0x16f/0xf80 mm/page_alloc.c:3460 release_pages+0x6f1/0x1780 mm/swap.c:980 tlb_batch_pages_flush mm/mmu_gather.c:50 [inline] tlb_flush_mmu_free mm/mmu_gather.c:243 [inline] tlb_flush_mmu mm/mmu_gather.c:250 [inline] tlb_finish_mmu+0x127/0x790 mm/mmu_gather.c:341 exit_mmap+0x19d/0x3f0 mm/mmap.c:3150 __mmput+0xed/0x430 kernel/fork.c:1183 exit_mm kernel/exit.c:510 [inline] do_exit+0x8e9/0x2470 kernel/exit.c:782 do_group_exit+0xb2/0x2a0 kernel/exit.c:925 __do_sys_exit_group kernel/exit.c:936 [inline] __se_sys_exit_group kernel/exit.c:934 [inline] __x64_sys_exit_group+0x35/0x40 kernel/exit.c:934 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+0x44/0xae Memory state around the buggy address: ffff88806db26f00: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc ffff88806db26f80: fa fb fc fc fa fb fc fc fa fb fc fc fa fb fc fc >ffff88806db27000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88806db27080: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88806db27100: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================