================================================================== BUG: KASAN: use-after-free in ovs_ct_limit_exit net/openvswitch/conntrack.c:1909 [inline] BUG: KASAN: use-after-free in ovs_ct_exit+0x2df/0x4a0 net/openvswitch/conntrack.c:2303 Read of size 8 at addr ffff88801d627880 by task kworker/u4:7/6661 CPU: 0 PID: 6661 Comm: kworker/u4:7 Not tainted 5.16.0-rc4-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 Workqueue: netns cleanup_net 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+0x8d/0x320 mm/kasan/report.c:247 __kasan_report mm/kasan/report.c:433 [inline] kasan_report.cold+0x83/0xdf mm/kasan/report.c:450 ovs_ct_limit_exit net/openvswitch/conntrack.c:1909 [inline] ovs_ct_exit+0x2df/0x4a0 net/openvswitch/conntrack.c:2303 ovs_exit_net+0x19c/0xbc0 net/openvswitch/datapath.c:2608 ops_exit_list+0xb0/0x160 net/core/net_namespace.c:168 cleanup_net+0x4ea/0xb00 net/core/net_namespace.c:595 process_one_work+0x9b2/0x1690 kernel/workqueue.c:2298 worker_thread+0x658/0x11f0 kernel/workqueue.c:2445 kthread+0x405/0x4f0 kernel/kthread.c:327 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 Allocated by task 18127: kasan_save_stack+0x1e/0x50 mm/kasan/common.c:38 kasan_set_track mm/kasan/common.c:46 [inline] set_alloc_info mm/kasan/common.c:434 [inline] ____kasan_kmalloc mm/kasan/common.c:513 [inline] ____kasan_kmalloc mm/kasan/common.c:472 [inline] __kasan_kmalloc+0xa9/0xd0 mm/kasan/common.c:522 kmalloc include/linux/slab.h:590 [inline] ovs_ct_limit_set_zone_limit net/openvswitch/conntrack.c:1972 [inline] ovs_ct_limit_cmd_set+0x3dd/0xc70 net/openvswitch/conntrack.c:2148 genl_family_rcv_msg_doit+0x228/0x320 net/netlink/genetlink.c:731 genl_family_rcv_msg net/netlink/genetlink.c:775 [inline] genl_rcv_msg+0x328/0x580 net/netlink/genetlink.c:792 netlink_rcv_skb+0x153/0x420 net/netlink/af_netlink.c:2492 genl_rcv+0x24/0x40 net/netlink/genetlink.c:803 netlink_unicast_kernel net/netlink/af_netlink.c:1315 [inline] netlink_unicast+0x533/0x7d0 net/netlink/af_netlink.c:1341 netlink_sendmsg+0x904/0xdf0 net/netlink/af_netlink.c:1917 sock_sendmsg_nosec net/socket.c:704 [inline] sock_sendmsg+0xcf/0x120 net/socket.c:724 ____sys_sendmsg+0x6e8/0x810 net/socket.c:2409 ___sys_sendmsg+0xf3/0x170 net/socket.c:2463 __sys_sendmsg+0xe5/0x1b0 net/socket.c:2492 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 Freed by task 3677: kasan_save_stack+0x1e/0x50 mm/kasan/common.c:38 kasan_set_track+0x21/0x30 mm/kasan/common.c:46 kasan_set_free_info+0x20/0x30 mm/kasan/generic.c:370 ____kasan_slab_free mm/kasan/common.c:366 [inline] ____kasan_slab_free mm/kasan/common.c:328 [inline] __kasan_slab_free+0xff/0x130 mm/kasan/common.c:374 kasan_slab_free include/linux/kasan.h:235 [inline] slab_free_hook mm/slub.c:1723 [inline] slab_free_freelist_hook+0x8b/0x1c0 mm/slub.c:1749 slab_free mm/slub.c:3513 [inline] kmem_cache_free_bulk mm/slub.c:3656 [inline] kmem_cache_free_bulk+0x40b/0xa70 mm/slub.c:3643 kfree_bulk include/linux/slab.h:446 [inline] kfree_rcu_work+0x51c/0xa10 kernel/rcu/tree.c:3273 process_one_work+0x9b2/0x1690 kernel/workqueue.c:2298 worker_thread+0x658/0x11f0 kernel/workqueue.c:2445 kthread+0x405/0x4f0 kernel/kthread.c:327 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 Last potentially related work creation: kasan_save_stack+0x1e/0x50 mm/kasan/common.c:38 __kasan_record_aux_stack+0xf5/0x120 mm/kasan/generic.c:348 kvfree_call_rcu+0x74/0x990 kernel/rcu/tree.c:3550 ovs_ct_limit_exit net/openvswitch/conntrack.c:1911 [inline] ovs_ct_exit+0x21e/0x4a0 net/openvswitch/conntrack.c:2303 ovs_exit_net+0x19c/0xbc0 net/openvswitch/datapath.c:2608 ops_exit_list+0xb0/0x160 net/core/net_namespace.c:168 cleanup_net+0x4ea/0xb00 net/core/net_namespace.c:595 process_one_work+0x9b2/0x1690 kernel/workqueue.c:2298 worker_thread+0x658/0x11f0 kernel/workqueue.c:2445 kthread+0x405/0x4f0 kernel/kthread.c:327 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 Second to last potentially related work creation: kasan_save_stack+0x1e/0x50 mm/kasan/common.c:38 __kasan_record_aux_stack+0xf5/0x120 mm/kasan/generic.c:348 __call_rcu kernel/rcu/tree.c:2985 [inline] call_rcu+0xb1/0x740 kernel/rcu/tree.c:3065 tnode_free+0xb5/0x120 net/ipv4/fib_trie.c:495 replace+0x120/0x4b0 net/ipv4/fib_trie.c:521 inflate net/ipv4/fib_trie.c:623 [inline] resize+0xfc5/0x2170 net/ipv4/fib_trie.c:868 trie_rebalance net/ipv4/fib_trie.c:1094 [inline] fib_insert_node net/ipv4/fib_trie.c:1138 [inline] fib_insert_alias+0xab6/0xde0 net/ipv4/fib_trie.c:1152 fib_table_insert+0x5a0/0x1af0 net/ipv4/fib_trie.c:1365 fib_magic+0x455/0x540 net/ipv4/fib_frontend.c:1087 fib_add_ifaddr+0x16c/0x500 net/ipv4/fib_frontend.c:1109 fib_inetaddr_event+0x162/0x2a0 net/ipv4/fib_frontend.c:1420 notifier_call_chain+0xb5/0x200 kernel/notifier.c:83 blocking_notifier_call_chain kernel/notifier.c:318 [inline] blocking_notifier_call_chain+0x67/0x90 kernel/notifier.c:306 __inet_insert_ifa+0x919/0xc20 net/ipv4/devinet.c:555 inet_rtm_newaddr+0xcb9/0x13c0 net/ipv4/devinet.c:958 rtnetlink_rcv_msg+0x413/0xb80 net/core/rtnetlink.c:5570 netlink_rcv_skb+0x153/0x420 net/netlink/af_netlink.c:2492 netlink_unicast_kernel net/netlink/af_netlink.c:1315 [inline] netlink_unicast+0x533/0x7d0 net/netlink/af_netlink.c:1341 netlink_sendmsg+0x904/0xdf0 net/netlink/af_netlink.c:1917 sock_sendmsg_nosec net/socket.c:704 [inline] sock_sendmsg+0xcf/0x120 net/socket.c:724 __sys_sendto+0x21c/0x320 net/socket.c:2036 __do_sys_sendto net/socket.c:2048 [inline] __se_sys_sendto net/socket.c:2044 [inline] __x64_sys_sendto+0xdd/0x1b0 net/socket.c:2044 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 The buggy address belongs to the object at ffff88801d627880 which belongs to the cache kmalloc-64 of size 64 The buggy address is located 0 bytes inside of 64-byte region [ffff88801d627880, ffff88801d6278c0) The buggy address belongs to the page: page:ffffea00007589c0 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1d627 flags: 0xfff00000000200(slab|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000000200 ffffea000061fbc0 dead000000000002 ffff888010c41640 raw: 0000000000000000 0000000000200020 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 0x12cc0(GFP_KERNEL|__GFP_NOWARN|__GFP_NORETRY), pid 54, ts 8679479083, free_ts 0 prep_new_page mm/page_alloc.c:2418 [inline] get_page_from_freelist+0xa72/0x2f50 mm/page_alloc.c:4149 __alloc_pages+0x1b2/0x500 mm/page_alloc.c:5369 alloc_pages+0x1a7/0x300 mm/mempolicy.c:2191 alloc_slab_page mm/slub.c:1793 [inline] allocate_slab mm/slub.c:1930 [inline] new_slab+0x32d/0x4a0 mm/slub.c:1993 ___slab_alloc+0x918/0xfe0 mm/slub.c:3022 __slab_alloc.constprop.0+0x4d/0xa0 mm/slub.c:3109 slab_alloc_node mm/slub.c:3200 [inline] slab_alloc mm/slub.c:3242 [inline] __kmalloc+0x2fb/0x340 mm/slub.c:4419 kmalloc include/linux/slab.h:595 [inline] kzalloc include/linux/slab.h:724 [inline] lsm_task_alloc security/security.c:614 [inline] security_task_alloc+0x10b/0x250 security/security.c:1644 copy_process+0x2132/0x75a0 kernel/fork.c:2173 kernel_clone+0xe7/0xab0 kernel/fork.c:2582 kernel_thread+0xb5/0xf0 kernel/fork.c:2634 call_usermodehelper_exec_work kernel/umh.c:174 [inline] call_usermodehelper_exec_work+0xcc/0x180 kernel/umh.c:160 process_one_work+0x9b2/0x1690 kernel/workqueue.c:2298 worker_thread+0x658/0x11f0 kernel/workqueue.c:2445 kthread+0x405/0x4f0 kernel/kthread.c:327 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 page_owner free stack trace missing Memory state around the buggy address: ffff88801d627780: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc ffff88801d627800: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc >ffff88801d627880: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ^ ffff88801d627900: fa fb fb fb fb fb fb fb fc fc fc fc fc fc fc fc ffff88801d627980: 00 00 00 00 00 00 00 00 fc fc fc fc fc fc fc fc ==================================================================