================================================================== 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 ffff88801d568a04 by task syz-executor.3/6514 CPU: 0 PID: 6514 Comm: syz-executor.3 Not tainted 5.18.0-syzkaller-11650-g2a5699b0de4e #0 CPU: 0 PID: 6514 Comm: syz-executor.3 Not tainted 5.18.0-syzkaller-11650-g2a5699b0de4e #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/0x467 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+0x334/0x810 net/socket.c:2492 ___sys_sendmsg+0xf3/0x170 net/socket.c:2546 __sys_sendmmsg+0x195/0x470 net/socket.c:2632 __do_sys_sendmmsg net/socket.c:2661 [inline] __se_sys_sendmmsg net/socket.c:2658 [inline] __x64_sys_sendmmsg+0x99/0x100 net/socket.c:2658 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:0x7fd939089109 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:00007fd93a200168 EFLAGS: 00000246 ORIG_RAX: 0000000000000133 RAX: ffffffffffffffda RBX: 00007fd93919c100 RCX: 00007fd939089109 RDX: 040000000000037b RSI: 0000000020005c00 RDI: 0000000000000005 RBP: 00007fd9390e308d R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffce0af53df R14: 00007fd93a200300 R15: 0000000000022000 Allocated by task 6514: 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+0x10c/0x190 mm/kasan/common.c:583 kasan_krealloc include/linux/kasan.h:254 [inline] __do_krealloc mm/slab_common.c:1181 [inline] krealloc+0x54/0xf0 mm/slab_common.c:1218 nf_ct_ext_add+0x19f/0x3d0 net/netfilter/nf_conntrack_extend.c:117 nf_ct_labels_ext_add include/net/netfilter/nf_conntrack_labels.h:45 [inline] init_conntrack.constprop.0+0x563/0x1270 net/netfilter/nf_conntrack_core.c:1734 resolve_normal_ct net/netfilter/nf_conntrack_core.c:1830 [inline] nf_conntrack_in+0xc86/0x1790 net/netfilter/nf_conntrack_core.c:1985 ipv4_conntrack_local+0x113/0x260 net/netfilter/nf_conntrack_proto.c:213 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 __ip_local_out+0x262/0x520 net/ipv4/ip_output.c:115 ip_local_out net/ipv4/ip_output.c:124 [inline] ip_send_skb+0x46/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+0x334/0x810 net/socket.c:2492 ___sys_sendmsg+0xf3/0x170 net/socket.c:2546 __sys_sendmmsg+0x195/0x470 net/socket.c:2632 __do_sys_sendmmsg net/socket.c:2661 [inline] __se_sys_sendmmsg net/socket.c:2658 [inline] __x64_sys_sendmmsg+0x99/0x100 net/socket.c:2658 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 6514: 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+0x13d/0x180 mm/kasan/common.c:328 kasan_slab_free include/linux/kasan.h:200 [inline] __cache_free mm/slab.c:3425 [inline] kfree+0x113/0x310 mm/slab.c:3796 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+0x334/0x810 net/socket.c:2492 ___sys_sendmsg+0xf3/0x170 net/socket.c:2546 __sys_sendmmsg+0x195/0x470 net/socket.c:2632 __do_sys_sendmmsg net/socket.c:2661 [inline] __se_sys_sendmmsg net/socket.c:2658 [inline] __x64_sys_sendmmsg+0x99/0x100 net/socket.c:2658 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+0x7e/0x90 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 ffff88801d568a00 which belongs to the cache kmalloc-128 of size 128 The buggy address is located 4 bytes inside of 128-byte region [ffff88801d568a00, ffff88801d568a80) The buggy address belongs to the physical page: page:ffffea0000755a00 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff88801d568d00 pfn:0x1d568 flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000200 ffffea0001f073c8 ffffea0001ee3688 ffff888010c40400 raw: ffff88801d568d00 ffff88801d568000 000000010000000d 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 0x2420c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_COMP|__GFP_THISNODE), pid 1, tgid 1 (swapper/0), ts 7367250563, free_ts 0 prep_new_page mm/page_alloc.c:2456 [inline] get_page_from_freelist+0x1290/0x3b70 mm/page_alloc.c:4198 __alloc_pages+0x1c7/0x510 mm/page_alloc.c:5426 __alloc_pages_node include/linux/gfp.h:587 [inline] kmem_getpages mm/slab.c:1363 [inline] cache_grow_begin+0x75/0x350 mm/slab.c:2569 cache_alloc_refill+0x27f/0x380 mm/slab.c:2942 ____cache_alloc mm/slab.c:3024 [inline] ____cache_alloc mm/slab.c:3007 [inline] __do_cache_alloc mm/slab.c:3253 [inline] slab_alloc mm/slab.c:3295 [inline] kmem_cache_alloc_trace+0x380/0x4a0 mm/slab.c:3567 kmalloc include/linux/slab.h:600 [inline] kmalloc_array include/linux/slab.h:639 [inline] con_insert_unipair+0x204/0x2c0 drivers/tty/vt/consolemap.c:491 con_set_default_unimap+0x262/0x400 drivers/tty/vt/consolemap.c:690 do_bind_con_driver.isra.0+0x4e2/0x910 drivers/tty/vt/vt.c:3693 do_take_over_console+0x44c/0x5c0 drivers/tty/vt/vt.c:4274 do_fbcon_takeover+0xe8/0x210 drivers/video/fbdev/core/fbcon.c:528 do_fb_registered drivers/video/fbdev/core/fbcon.c:2955 [inline] fbcon_fb_registered+0x346/0x460 drivers/video/fbdev/core/fbcon.c:2975 do_register_framebuffer drivers/video/fbdev/core/fbmem.c:1671 [inline] register_framebuffer+0x55d/0x900 drivers/video/fbdev/core/fbmem.c:1829 __drm_fb_helper_initial_config_and_unlock+0xe1c/0x13b0 drivers/gpu/drm/drm_fb_helper.c:1898 drm_fb_helper_initial_config drivers/gpu/drm/drm_fb_helper.c:1964 [inline] drm_fb_helper_initial_config drivers/gpu/drm/drm_fb_helper.c:1956 [inline] drm_fbdev_client_hotplug+0x32c/0x590 drivers/gpu/drm/drm_fb_helper.c:2478 drm_fbdev_generic_setup+0x1cc/0x460 drivers/gpu/drm/drm_fb_helper.c:2565 vkms_create drivers/gpu/drm/vkms/vkms_drv.c:208 [inline] vkms_init+0x565/0x5e9 drivers/gpu/drm/vkms/vkms_drv.c:233 page_owner free stack trace missing Memory state around the buggy address: ffff88801d568900: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff88801d568980: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc >ffff88801d568a00: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff88801d568a80: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc ffff88801d568b00: 00 00 00 00 00 00 00 00 00 00 00 00 00 fc fc fc ==================================================================