bond0 (unregistering): (slave bond_slave_1): Releasing backup interface bond0 (unregistering): (slave bond_slave_0): Releasing backup interface bond0 (unregistering): Released all slaves ================================================================== BUG: KASAN: use-after-free in free_netdev+0x590/0x620 net/core/dev.c:10714 Read of size 8 at addr ffff888078612160 by task kworker/u4:10/15489 CPU: 0 PID: 15489 Comm: kworker/u4:10 Not tainted 6.1.0-rc5-next-20221116-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/26/2022 Workqueue: netns cleanup_net Call Trace: __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0xd1/0x138 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:253 [inline] print_report+0x15e/0x45d mm/kasan/report.c:364 kasan_report+0xbf/0x1f0 mm/kasan/report.c:464 free_netdev+0x590/0x620 net/core/dev.c:10714 netdev_run_todo+0xb4e/0x1100 net/core/dev.c:10366 default_device_exit_batch+0x456/0x590 net/core/dev.c:11353 ops_exit_list+0x125/0x170 net/core/net_namespace.c:174 cleanup_net+0x4ee/0xb10 net/core/net_namespace.c:606 process_one_work+0x9bf/0x1710 kernel/workqueue.c:2289 worker_thread+0x669/0x1090 kernel/workqueue.c:2436 kthread+0x2e8/0x3a0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308 Allocated by task 12424: kasan_save_stack+0x22/0x40 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 ____kasan_kmalloc mm/kasan/common.c:376 [inline] ____kasan_kmalloc mm/kasan/common.c:335 [inline] __kasan_kmalloc+0xa5/0xb0 mm/kasan/common.c:385 kasan_kmalloc include/linux/kasan.h:212 [inline] __do_kmalloc_node mm/slab_common.c:955 [inline] __kmalloc+0x5a/0xd0 mm/slab_common.c:968 kmalloc_array include/linux/slab.h:627 [inline] kcalloc include/linux/slab.h:658 [inline] veth_alloc_queues drivers/net/veth.c:1404 [inline] veth_dev_init+0x156/0x330 drivers/net/veth.c:1431 register_netdevice+0x573/0x1640 net/core/dev.c:9987 veth_newlink+0x33c/0x9a0 drivers/net/veth.c:1828 rtnl_newlink_create net/core/rtnetlink.c:3407 [inline] __rtnl_newlink+0x10c2/0x1840 net/core/rtnetlink.c:3624 rtnl_newlink+0x68/0xa0 net/core/rtnetlink.c:3637 rtnetlink_rcv_msg+0x43e/0xca0 net/core/rtnetlink.c:6141 netlink_rcv_skb+0x165/0x440 net/netlink/af_netlink.c:2564 netlink_unicast_kernel net/netlink/af_netlink.c:1330 [inline] netlink_unicast+0x547/0x7f0 net/netlink/af_netlink.c:1356 netlink_sendmsg+0x91b/0xe10 net/netlink/af_netlink.c:1932 sock_sendmsg_nosec net/socket.c:714 [inline] sock_sendmsg+0xd3/0x120 net/socket.c:734 __sys_sendto+0x23a/0x340 net/socket.c:2117 __do_sys_sendto net/socket.c:2129 [inline] __se_sys_sendto net/socket.c:2125 [inline] __x64_sys_sendto+0xe1/0x1b0 net/socket.c:2125 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd Freed by task 15489: kasan_save_stack+0x22/0x40 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 kasan_save_free_info+0x2e/0x40 mm/kasan/generic.c:518 ____kasan_slab_free mm/kasan/common.c:241 [inline] ____kasan_slab_free+0x160/0x1c0 mm/kasan/common.c:205 kasan_slab_free include/linux/kasan.h:178 [inline] slab_free_hook mm/slub.c:1763 [inline] slab_free_freelist_hook+0x8b/0x1c0 mm/slub.c:1789 slab_free mm/slub.c:3696 [inline] __kmem_cache_free+0xaf/0x3b0 mm/slub.c:3709 veth_free_queues drivers/net/veth.c:1420 [inline] veth_dev_free+0x37/0x70 drivers/net/veth.c:1442 netdev_run_todo+0x6bf/0x1100 net/core/dev.c:10364 default_device_exit_batch+0x456/0x590 net/core/dev.c:11353 ops_exit_list+0x125/0x170 net/core/net_namespace.c:174 cleanup_net+0x4ee/0xb10 net/core/net_namespace.c:606 process_one_work+0x9bf/0x1710 kernel/workqueue.c:2289 worker_thread+0x669/0x1090 kernel/workqueue.c:2436 kthread+0x2e8/0x3a0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308 Last potentially related work creation: kasan_save_stack+0x22/0x40 mm/kasan/common.c:45 __kasan_record_aux_stack+0xbc/0xd0 mm/kasan/generic.c:488 kvfree_call_rcu+0x70/0x8d0 kernel/rcu/tree.c:3217 drop_sysctl_table+0x3c2/0x4e0 fs/proc/proc_sysctl.c:1709 unregister_sysctl_table fs/proc/proc_sysctl.c:1747 [inline] unregister_sysctl_table+0xc4/0x190 fs/proc/proc_sysctl.c:1722 __devinet_sysctl_unregister net/ipv4/devinet.c:2609 [inline] devinet_sysctl_unregister net/ipv4/devinet.c:2637 [inline] inetdev_destroy net/ipv4/devinet.c:327 [inline] inetdev_event+0x1045/0x1650 net/ipv4/devinet.c:1602 notifier_call_chain+0xb5/0x200 kernel/notifier.c:87 call_netdevice_notifiers_info+0xb5/0x130 net/core/dev.c:1944 call_netdevice_notifiers_extack net/core/dev.c:1982 [inline] call_netdevice_notifiers net/core/dev.c:1996 [inline] unregister_netdevice_many_notify+0xa2b/0x19e0 net/core/dev.c:10843 unregister_netdevice_many net/core/dev.c:10899 [inline] default_device_exit_batch+0x451/0x590 net/core/dev.c:11352 ops_exit_list+0x125/0x170 net/core/net_namespace.c:174 cleanup_net+0x4ee/0xb10 net/core/net_namespace.c:606 process_one_work+0x9bf/0x1710 kernel/workqueue.c:2289 worker_thread+0x669/0x1090 kernel/workqueue.c:2436 kthread+0x2e8/0x3a0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308 Second to last potentially related work creation: kasan_save_stack+0x22/0x40 mm/kasan/common.c:45 __kasan_record_aux_stack+0xbc/0xd0 mm/kasan/generic.c:488 __call_rcu_common.constprop.0+0x99/0x820 kernel/rcu/tree.c:2601 in6_dev_finish_destroy+0x172/0x1f0 net/ipv6/addrconf_core.c:271 in6_dev_put include/net/addrconf.h:380 [inline] addrconf_ifdown.isra.0+0x15a3/0x1920 net/ipv6/addrconf.c:3906 addrconf_notify+0x104/0x1c80 net/ipv6/addrconf.c:3673 notifier_call_chain+0xb5/0x200 kernel/notifier.c:87 call_netdevice_notifiers_info+0xb5/0x130 net/core/dev.c:1944 call_netdevice_notifiers_extack net/core/dev.c:1982 [inline] call_netdevice_notifiers net/core/dev.c:1996 [inline] unregister_netdevice_many_notify+0xa2b/0x19e0 net/core/dev.c:10843 vti6_exit_batch_net+0x3a4/0x670 net/ipv6/ip6_vti.c:1190 ops_exit_list+0x125/0x170 net/core/net_namespace.c:174 cleanup_net+0x4ee/0xb10 net/core/net_namespace.c:606 process_one_work+0x9bf/0x1710 kernel/workqueue.c:2289 worker_thread+0x669/0x1090 kernel/workqueue.c:2436 kthread+0x2e8/0x3a0 kernel/kthread.c:376 ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:308 The buggy address belongs to the object at ffff888078612000 which belongs to the cache kmalloc-cg-2k of size 2048 The buggy address is located 352 bytes inside of 2048-byte region [ffff888078612000, ffff888078612800) The buggy address belongs to the physical page: page:ffffea0001e18400 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x78610 head:ffffea0001e18400 order:3 compound_mapcount:0 subpages_mapcount:0 compound_pincount:0 memcg:ffff88813fe1a581 flags: 0xfff00000010200(slab|head|node=0|zone=1|lastcpupid=0x7ff) raw: 00fff00000010200 ffff88801244c140 dead000000000100 dead000000000122 raw: 0000000000000000 0000000000080008 00000001ffffffff ffff88813fe1a581 page dumped because: kasan: bad access detected page_owner tracks the page as allocated page last allocated via order 3, migratetype Unmovable, gfp_mask 0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC), pid 5339, tgid 5339 (syz-executor.4), ts 200965272629, free_ts 189880813303 prep_new_page mm/page_alloc.c:2561 [inline] get_page_from_freelist+0x10b5/0x2d50 mm/page_alloc.c:4310 __alloc_pages+0x1cb/0x5b0 mm/page_alloc.c:5569 alloc_pages+0x1aa/0x270 mm/mempolicy.c:2285 alloc_slab_page mm/slub.c:1833 [inline] allocate_slab+0x25e/0x350 mm/slub.c:1980 new_slab mm/slub.c:2033 [inline] ___slab_alloc+0xa91/0x1400 mm/slub.c:3211 __slab_alloc.constprop.0+0x56/0xa0 mm/slub.c:3310 slab_alloc_node mm/slub.c:3395 [inline] __kmem_cache_alloc_node+0x1a9/0x430 mm/slub.c:3472 __do_kmalloc_node mm/slab_common.c:954 [inline] __kmalloc+0x4a/0xd0 mm/slab_common.c:968 kmalloc include/linux/slab.h:580 [inline] kzalloc include/linux/slab.h:711 [inline] __register_sysctl_table+0x116/0x10a0 fs/proc/proc_sysctl.c:1337 __addrconf_sysctl_register+0x1db/0x3d0 net/ipv6/addrconf.c:7083 addrconf_sysctl_register net/ipv6/addrconf.c:7130 [inline] addrconf_sysctl_register+0x139/0x1d0 net/ipv6/addrconf.c:7119 ipv6_add_dev+0xa80/0x1320 net/ipv6/addrconf.c:450 addrconf_notify+0x874/0x1c80 net/ipv6/addrconf.c:3528 notifier_call_chain+0xb5/0x200 kernel/notifier.c:87 call_netdevice_notifiers_info+0xb5/0x130 net/core/dev.c:1944 call_netdevice_notifiers_extack net/core/dev.c:1982 [inline] call_netdevice_notifiers net/core/dev.c:1996 [inline] register_netdevice+0xfb4/0x1640 net/core/dev.c:10090 page last free stack trace: reset_page_owner include/linux/page_owner.h:24 [inline] free_pages_prepare mm/page_alloc.c:1468 [inline] free_pcp_prepare+0x65c/0xc00 mm/page_alloc.c:1518 free_unref_page_prepare mm/page_alloc.c:3409 [inline] free_unref_page+0x1d/0x4d0 mm/page_alloc.c:3505 __unfreeze_partials+0x17c/0x1a0 mm/slub.c:2617 qlink_free mm/kasan/quarantine.c:168 [inline] qlist_free_all+0x6a/0x170 mm/kasan/quarantine.c:187 kasan_quarantine_reduce+0x192/0x220 mm/kasan/quarantine.c:294 __kasan_slab_alloc+0x66/0x90 mm/kasan/common.c:307 kasan_slab_alloc include/linux/kasan.h:202 [inline] slab_post_alloc_hook mm/slab.h:761 [inline] slab_alloc_node mm/slub.c:3433 [inline] kmem_cache_alloc_node+0x1f3/0x460 mm/slub.c:3478 __alloc_skb+0x216/0x310 net/core/skbuff.c:498 alloc_skb_fclone include/linux/skbuff.h:1319 [inline] tcp_stream_alloc_skb+0x3c/0x580 net/ipv4/tcp.c:862 tcp_sendmsg_locked+0xc4f/0x2960 net/ipv4/tcp.c:1325 tcp_sendmsg+0x2f/0x50 net/ipv4/tcp.c:1483 inet_sendmsg+0x9d/0xe0 net/ipv4/af_inet.c:827 sock_sendmsg_nosec net/socket.c:714 [inline] sock_sendmsg+0xd3/0x120 net/socket.c:734 sock_write_iter+0x295/0x3d0 net/socket.c:1108 call_write_iter include/linux/fs.h:2160 [inline] new_sync_write fs/read_write.c:491 [inline] vfs_write+0xa45/0xe40 fs/read_write.c:584 ksys_write+0x1ec/0x250 fs/read_write.c:637 Memory state around the buggy address: ffff888078612000: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888078612080: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb >ffff888078612100: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ^ ffff888078612180: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ffff888078612200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb ==================================================================