netdevsim netdevsim0 netdevsim3 (unregistering): unset [1, 0] type 2 family 0 port 6081 - 0
======================================================
WARNING: possible circular locking dependency detected
syzkaller #0 Not tainted
------------------------------------------------------
kworker/u8:50/17220 is trying to acquire lock:
ffffffff91481b60 (xps_map_mutex){+.+.}-{4:4}, at: netif_reset_xps_queues net/core/dev.c:2850 [inline]
ffffffff91481b60 (xps_map_mutex){+.+.}-{4:4}, at: netif_reset_xps_queues_gt+0x6f/0xc0 net/core/dev.c:2863
but task is already holding lock:
ffffffff8fde6090 (cpu_hotplug_lock){++++}-{0:0}, at: netif_reset_xps_queues net/core/dev.c:2849 [inline]
ffffffff8fde6090 (cpu_hotplug_lock){++++}-{0:0}, at: netif_reset_xps_queues_gt+0x61/0xc0 net/core/dev.c:2863
which lock already depends on the new lock.
the existing dependency chain (in reverse order) is:
-> #7 (cpu_hotplug_lock){++++}-{0:0}:
percpu_down_read_internal include/linux/percpu-rwsem.h:53 [inline]
percpu_down_read include/linux/percpu-rwsem.h:77 [inline]
cpus_read_lock+0x3d/0x160 kernel/cpu.c:490
static_key_slow_inc+0x12/0x30 kernel/jump_label.c:190
nbd_genl_reconnect_sock_cb+0x69a/0xbb0 drivers/block/nbd.c:1377
nbd_genl_foreach_sock+0x265/0x450 drivers/block/nbd.c:2152
nbd_genl_reconfigure+0xbbb/0x1040 drivers/block/nbd.c:2477
genl_family_rcv_msg_doit+0x233/0x340 net/netlink/genetlink.c:1114
genl_family_rcv_msg net/netlink/genetlink.c:1194 [inline]
genl_rcv_msg+0x614/0x7a0 net/netlink/genetlink.c:1209
netlink_rcv_skb+0x226/0x4a0 net/netlink/af_netlink.c:2584
genl_rcv+0x28/0x40 net/netlink/genetlink.c:1218
netlink_unicast_kernel net/netlink/af_netlink.c:1335 [inline]
netlink_unicast+0x8ef/0xa80 net/netlink/af_netlink.c:1361
netlink_sendmsg+0x7f0/0xb20 net/netlink/af_netlink.c:1920
sock_sendmsg_nosec+0x14e/0x190 net/socket.c:800
__sock_sendmsg net/socket.c:818 [inline]
____sys_sendmsg+0x54e/0x850 net/socket.c:2715
___sys_sendmsg+0x2a5/0x360 net/socket.c:2769
__sys_sendmsg net/socket.c:2801 [inline]
__do_sys_sendmsg net/socket.c:2806 [inline]
__se_sys_sendmsg net/socket.c:2804 [inline]
__x64_sys_sendmsg+0x1b1/0x290 net/socket.c:2804
do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline]
do_syscall_64+0x166/0x520 arch/x86/entry/syscall_64.c:84
entry_SYSCALL_64_after_hwframe+0x77/0x7f
-> #6 (&nsock->tx_lock){+.+.}-{4:4}:
__mutex_lock_common kernel/locking/mutex.c:646 [inline]
__mutex_lock+0x197/0x15a0 kernel/locking/mutex.c:821
nbd_handle_cmd drivers/block/nbd.c:1143 [inline]
nbd_queue_rq+0x373/0xff0 drivers/block/nbd.c:1207
blk_mq_dispatch_rq_list+0x499/0x1990 block/blk-mq.c:2131
__blk_mq_do_dispatch_sched block/blk-mq-sched.c:168 [inline]
blk_mq_do_dispatch_sched block/blk-mq-sched.c:182 [inline]
__blk_mq_sched_dispatch_requests+0xd36/0x1580 block/blk-mq-sched.c:307
blk_mq_sched_dispatch_requests+0xd7/0x190 block/blk-mq-sched.c:329
blk_mq_run_work_fn+0x167/0x2f0 block/blk-mq.c:2546
process_one_work kernel/workqueue.c:3495 [inline]
process_scheduled_works+0xc3d/0x1630 kernel/workqueue.c:3578
worker_thread+0xa47/0xfb0 kernel/workqueue.c:3659
kthread+0x38b/0x480 kernel/kthread.c:436
ret_from_fork+0x514/0xb70 arch/x86/kernel/process.c:158
ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245
-> #5 (&cmd->lock){+.+.}-{4:4}:
__mutex_lock_common kernel/locking/mutex.c:646 [inline]
__mutex_lock+0x197/0x15a0 kernel/locking/mutex.c:821
nbd_queue_rq+0xc1/0xff0 drivers/block/nbd.c:1199
blk_mq_dispatch_rq_list+0x499/0x1990 block/blk-mq.c:2131
__blk_mq_do_dispatch_sched block/blk-mq-sched.c:168 [inline]
blk_mq_do_dispatch_sched block/blk-mq-sched.c:182 [inline]
__blk_mq_sched_dispatch_requests+0xd36/0x1580 block/blk-mq-sched.c:307
blk_mq_sched_dispatch_requests+0xd7/0x190 block/blk-mq-sched.c:329
blk_mq_run_work_fn+0x167/0x2f0 block/blk-mq.c:2546
process_one_work kernel/workqueue.c:3495 [inline]
process_scheduled_works+0xc3d/0x1630 kernel/workqueue.c:3578
worker_thread+0xa47/0xfb0 kernel/workqueue.c:3659
kthread+0x38b/0x480 kernel/kthread.c:436
ret_from_fork+0x514/0xb70 arch/x86/kernel/process.c:158
ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245
-> #4 (set->srcu){.+.+}-{0:0}:
srcu_lock_sync include/linux/srcu.h:225 [inline]
__synchronize_srcu+0xca/0x2f0 kernel/rcu/srcutree.c:1662
elevator_switch+0x1e8/0x7b0 block/elevator.c:576
elevator_change+0x2fa/0x480 block/elevator.c:681
elevator_set_default+0x375/0x440 block/elevator.c:754
blk_register_queue+0x404/0x4f0 block/blk-sysfs.c:992
__add_disk+0x6b8/0xdb0 block/genhd.c:531
add_disk_fwnode+0x100/0x3a0 block/genhd.c:600
add_disk include/linux/blkdev.h:801 [inline]
nbd_dev_add+0x733/0xb60 drivers/block/nbd.c:2026
nbd_init+0x168/0x1f0 drivers/block/nbd.c:2743
do_one_initcall+0x250/0x870 init/main.c:1419
do_initcall_level+0x10a/0x1a0 init/main.c:1481
do_initcalls+0x59/0xa0 init/main.c:1497
kernel_init_freeable+0x29d/0x3e0 init/main.c:1732
kernel_init+0x22/0x1d0 init/main.c:1622
ret_from_fork+0x514/0xb70 arch/x86/kernel/process.c:158
ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245
-> #3 (&q->elevator_lock){+.+.}-{4:4}:
__mutex_lock_common kernel/locking/mutex.c:646 [inline]
__mutex_lock+0x197/0x15a0 kernel/locking/mutex.c:821
elevator_change+0x1af/0x480 block/elevator.c:679
elevator_set_none+0xb5/0x140 block/elevator.c:769
blk_mq_elv_switch_none block/blk-mq.c:5114 [inline]
__blk_mq_update_nr_hw_queues block/blk-mq.c:5159 [inline]
blk_mq_update_nr_hw_queues+0x5ef/0x19e0 block/blk-mq.c:5224
nbd_start_device+0x189/0xb30 drivers/block/nbd.c:1530
nbd_genl_connect+0x167d/0x1cd0 drivers/block/nbd.c:2310
genl_family_rcv_msg_doit+0x233/0x340 net/netlink/genetlink.c:1114
genl_family_rcv_msg net/netlink/genetlink.c:1194 [inline]
genl_rcv_msg+0x614/0x7a0 net/netlink/genetlink.c:1209
netlink_rcv_skb+0x226/0x4a0 net/netlink/af_netlink.c:2584
genl_rcv+0x28/0x40 net/netlink/genetlink.c:1218
netlink_unicast_kernel net/netlink/af_netlink.c:1335 [inline]
netlink_unicast+0x8ef/0xa80 net/netlink/af_netlink.c:1361
netlink_sendmsg+0x7f0/0xb20 net/netlink/af_netlink.c:1920
sock_sendmsg_nosec+0x14e/0x190 net/socket.c:800
__sock_sendmsg net/socket.c:818 [inline]
____sys_sendmsg+0x54e/0x850 net/socket.c:2715
___sys_sendmsg+0x2a5/0x360 net/socket.c:2769
__sys_sendmsg net/socket.c:2801 [inline]
__do_sys_sendmsg net/socket.c:2806 [inline]
__se_sys_sendmsg net/socket.c:2804 [inline]
__x64_sys_sendmsg+0x1b1/0x290 net/socket.c:2804
do_syscall_x64 arch/x86/entry/syscall_64.c:61 [inline]
do_syscall_64+0x166/0x520 arch/x86/entry/syscall_64.c:84
entry_SYSCALL_64_after_hwframe+0x77/0x7f
-> #2 (&q->q_usage_counter(io)#49){++++}-{0:0}:
blk_alloc_queue+0x544/0x690 block/blk-core.c:505
blk_mq_alloc_queue block/blk-mq.c:4439 [inline]
__blk_mq_alloc_disk+0x194/0x390 block/blk-mq.c:4486
nbd_dev_add+0x494/0xb60 drivers/block/nbd.c:1996
nbd_init+0x168/0x1f0 drivers/block/nbd.c:2743
do_one_initcall+0x250/0x870 init/main.c:1419
do_initcall_level+0x10a/0x1a0 init/main.c:1481
do_initcalls+0x59/0xa0 init/main.c:1497
kernel_init_freeable+0x29d/0x3e0 init/main.c:1732
kernel_init+0x22/0x1d0 init/main.c:1622
ret_from_fork+0x514/0xb70 arch/x86/kernel/process.c:158
ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245
-> #1 (fs_reclaim){+.+.}-{0:0}:
__fs_reclaim_acquire mm/page_alloc.c:4360 [inline]
fs_reclaim_acquire+0x71/0x100 mm/page_alloc.c:4374
might_alloc include/linux/sched/mm.h:316 [inline]
slab_pre_alloc_hook mm/slub.c:4673 [inline]
slab_alloc_node mm/slub.c:5011 [inline]
__do_kmalloc_node mm/slub.c:5530 [inline]
__kmalloc_noprof+0xbc/0x710 mm/slub.c:5556
_kmalloc_noprof include/linux/slab.h:995 [inline]
_kzalloc_noprof include/linux/slab.h:1312 [inline]
__netif_set_xps_queue+0x4fd/0x1e00 net/core/dev.c:2983
virtnet_set_affinity+0x586/0x6c0 drivers/net/virtio_net.c:4037
init_vqs+0x1085/0x11c0 drivers/net/virtio_net.c:6603
virtnet_probe+0x219b/0x4840 drivers/net/virtio_net.c:7004
virtio_dev_probe+0xdec/0x10b0 drivers/virtio/virtio.c:349
call_driver_probe drivers/base/dd.c:-1 [inline]
really_probe+0x254/0xae0 drivers/base/dd.c:707
__driver_probe_device+0x1e8/0x360 drivers/base/dd.c:869
driver_probe_device+0x4f/0x240 drivers/base/dd.c:899
__driver_attach+0x34e/0x630 drivers/base/dd.c:1300
bus_for_each_dev+0x23b/0x2c0 drivers/base/bus.c:386
bus_add_driver+0x38f/0x6e0 drivers/base/bus.c:785
driver_register+0x23a/0x320 drivers/base/driver.c:174
virtio_net_driver_init+0x71/0xa0 drivers/net/virtio_net.c:7328
do_one_initcall+0x250/0x870 init/main.c:1419
do_initcall_level+0x10a/0x1a0 init/main.c:1481
do_initcalls+0x59/0xa0 init/main.c:1497
kernel_init_freeable+0x29d/0x3e0 init/main.c:1732
kernel_init+0x22/0x1d0 init/main.c:1622
ret_from_fork+0x514/0xb70 arch/x86/kernel/process.c:158
ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245
-> #0 (xps_map_mutex){+.+.}-{4:4}:
check_prev_add kernel/locking/lockdep.c:3209 [inline]
check_prevs_add kernel/locking/lockdep.c:3328 [inline]
validate_chain kernel/locking/lockdep.c:3952 [inline]
__lock_acquire+0x164c/0x2de0 kernel/locking/lockdep.c:5288
lock_acquire+0x115/0x350 kernel/locking/lockdep.c:5942
__mutex_lock_common kernel/locking/mutex.c:646 [inline]
__mutex_lock+0x197/0x15a0 kernel/locking/mutex.c:821
netif_reset_xps_queues net/core/dev.c:2850 [inline]
netif_reset_xps_queues_gt+0x6f/0xc0 net/core/dev.c:2863
unregister_netdevice_many_notify+0x1824/0x1d80 net/core/dev.c:12763
unregister_netdevice_many net/core/dev.c:12798 [inline]
unregister_netdevice_queue+0x2f5/0x340 net/core/dev.c:12594
unregister_netdevice include/linux/netdevice.h:3509 [inline]
nsim_destroy+0x275/0x800 drivers/net/netdevsim/netdev.c:1227
__nsim_dev_port_del+0x14e/0x200 drivers/net/netdevsim/dev.c:1472
nsim_dev_port_del_all drivers/net/netdevsim/dev.c:1486 [inline]
nsim_dev_reload_destroy+0x288/0x490 drivers/net/netdevsim/dev.c:1710
nsim_dev_reload_down+0x8a/0xc0 drivers/net/netdevsim/dev.c:963
devlink_reload+0x1ed/0x7f0 net/devlink/dev.c:462
devlink_pernet_pre_exit+0x1d9/0x560 net/devlink/core.c:584
ops_pre_exit_list net/core/net_namespace.c:161 [inline]
ops_undo_list+0x17d/0x8f0 net/core/net_namespace.c:235
cleanup_net+0x572/0x810 net/core/net_namespace.c:706
process_one_work kernel/workqueue.c:3495 [inline]
process_scheduled_works+0xc3d/0x1630 kernel/workqueue.c:3578
worker_thread+0xa47/0xfb0 kernel/workqueue.c:3659
kthread+0x38b/0x480 kernel/kthread.c:436
ret_from_fork+0x514/0xb70 arch/x86/kernel/process.c:158
ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245
other info that might help us debug this:
Chain exists of:
xps_map_mutex --> &nsock->tx_lock --> cpu_hotplug_lock
Possible unsafe locking scenario:
CPU0 CPU1
---- ----
rlock(cpu_hotplug_lock);
lock(&nsock->tx_lock);
lock(cpu_hotplug_lock);
lock(xps_map_mutex);
*** DEADLOCK ***
locks held by kworker/u8:50/17220: 7, last CPU#1:
#0: ffff88801cec6148 ((wq_completion)netns){+.+.}-{0:0}, at: rcu_lock_acquire include/linux/rcupdate.h:309 [inline]
#0: ffff88801cec6148 ((wq_completion)netns){+.+.}-{0:0}, at: rcu_read_lock include/linux/rcupdate.h:849 [inline]
#0: ffff88801cec6148 ((wq_completion)netns){+.+.}-{0:0}, at: process_one_work kernel/workqueue.c:3460 [inline]
#0: ffff88801cec6148 ((wq_completion)netns){+.+.}-{0:0}, at: process_scheduled_works+0x97a/0x1630 kernel/workqueue.c:3578
#1: ffffc90005317c40 (net_cleanup_work){+.+.}-{0:0}, at: rcu_lock_acquire include/linux/rcupdate.h:309 [inline]
#1: ffffc90005317c40 (net_cleanup_work){+.+.}-{0:0}, at: rcu_read_lock include/linux/rcupdate.h:849 [inline]
#1: ffffc90005317c40 (net_cleanup_work){+.+.}-{0:0}, at: process_one_work kernel/workqueue.c:3460 [inline]
#1: ffffc90005317c40 (net_cleanup_work){+.+.}-{0:0}, at: process_scheduled_works+0x97a/0x1630 kernel/workqueue.c:3578
#2: ffffffff9147d628 (pernet_ops_rwsem){++++}-{4:4}, at: cleanup_net+0xf5/0x810 net/core/net_namespace.c:677
#3: ffff88803752b128 (&dev->mutex){....}-{4:4}, at: device_lock include/linux/device.h:1109 [inline]
#3: ffff88803752b128 (&dev->mutex){....}-{4:4}, at: devl_dev_lock net/devlink/devl_internal.h:124 [inline]
#3: ffff88803752b128 (&dev->mutex){....}-{4:4}, at: devlink_pernet_pre_exit+0x122/0x560 net/devlink/core.c:581
#4: ffff88802c00b258 (&devlink->lock_key#6){+.+.}-{4:4}, at: devl_lock net/devlink/core.c:314 [inline]
#4: ffff88802c00b258 (&devlink->lock_key#6){+.+.}-{4:4}, at: devl_dev_lock net/devlink/devl_internal.h:125 [inline]
#4: ffff88802c00b258 (&devlink->lock_key#6){+.+.}-{4:4}, at: devlink_pernet_pre_exit+0x138/0x560 net/devlink/core.c:581
#5: ffffffff9148c2e0 (rtnl_mutex){+.+.}-{4:4}, at: nsim_destroy+0x173/0x800 drivers/net/netdevsim/netdev.c:1222
#6: ffffffff8fde6090 (cpu_hotplug_lock){++++}-{0:0}, at: netif_reset_xps_queues net/core/dev.c:2849 [inline]
#6: ffffffff8fde6090 (cpu_hotplug_lock){++++}-{0:0}, at: netif_reset_xps_queues_gt+0x61/0xc0 net/core/dev.c:2863
stack backtrace:
CPU: 1 UID: 0 PID: 17220 Comm: kworker/u8:50 Not tainted syzkaller #0 PREEMPT(full)
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 10/15/2026
Workqueue: netns cleanup_net
Call Trace:
dump_stack_lvl+0xe8/0x150 lib/dump_stack.c:120
print_circular_bug+0x2e2/0x300 kernel/locking/lockdep.c:2087
check_noncircular+0x12f/0x150 kernel/locking/lockdep.c:2219
check_prev_add kernel/locking/lockdep.c:3209 [inline]
check_prevs_add kernel/locking/lockdep.c:3328 [inline]
validate_chain kernel/locking/lockdep.c:3952 [inline]
__lock_acquire+0x164c/0x2de0 kernel/locking/lockdep.c:5288
lock_acquire+0x115/0x350 kernel/locking/lockdep.c:5942
__mutex_lock_common kernel/locking/mutex.c:646 [inline]
__mutex_lock+0x197/0x15a0 kernel/locking/mutex.c:821
netif_reset_xps_queues net/core/dev.c:2850 [inline]
netif_reset_xps_queues_gt+0x6f/0xc0 net/core/dev.c:2863
unregister_netdevice_many_notify+0x1824/0x1d80 net/core/dev.c:12763
unregister_netdevice_many net/core/dev.c:12798 [inline]
unregister_netdevice_queue+0x2f5/0x340 net/core/dev.c:12594
unregister_netdevice include/linux/netdevice.h:3509 [inline]
nsim_destroy+0x275/0x800 drivers/net/netdevsim/netdev.c:1227
__nsim_dev_port_del+0x14e/0x200 drivers/net/netdevsim/dev.c:1472
nsim_dev_port_del_all drivers/net/netdevsim/dev.c:1486 [inline]
nsim_dev_reload_destroy+0x288/0x490 drivers/net/netdevsim/dev.c:1710
nsim_dev_reload_down+0x8a/0xc0 drivers/net/netdevsim/dev.c:963
devlink_reload+0x1ed/0x7f0 net/devlink/dev.c:462
devlink_pernet_pre_exit+0x1d9/0x560 net/devlink/core.c:584
ops_pre_exit_list net/core/net_namespace.c:161 [inline]
ops_undo_list+0x17d/0x8f0 net/core/net_namespace.c:235
cleanup_net+0x572/0x810 net/core/net_namespace.c:706
process_one_work kernel/workqueue.c:3495 [inline]
process_scheduled_works+0xc3d/0x1630 kernel/workqueue.c:3578
worker_thread+0xa47/0xfb0 kernel/workqueue.c:3659
kthread+0x38b/0x480 kernel/kthread.c:436
ret_from_fork+0x514/0xb70 arch/x86/kernel/process.c:158
ret_from_fork_asm+0x1a/0x30 arch/x86/entry/entry_64.S:245
netdevsim netdevsim0 netdevsim2 (unregistering): unset [1, 0] type 2 family 0 port 6081 - 0
team0: Port device netdevsim1 removed
netdevsim netdevsim0 netdevsim1 (unregistering): unset [1, 0] type 2 family 0 port 6081 - 0
netdevsim netdevsim0 netdevsim0 (unregistering): unset [1, 0] type 2 family 0 port 6081 - 0
bond0: left allmulticast mode
bond_slave_0: left allmulticast mode
bond_slave_1: left allmulticast mode
bond0: left promiscuous mode
bond_slave_0: left promiscuous mode
bond_slave_1: left promiscuous mode
bridge0: port 3(bond0) entered disabled state
bridge_slave_1: left allmulticast mode
bridge_slave_1: left promiscuous mode
bridge0: port 2(bridge_slave_1) entered disabled state
bond0 (unregistering): (slave bond_slave_0): Releasing backup interface
bond0 (unregistering): (slave bond_slave_1): Releasing backup interface
bond0 (unregistering): Released all slaves
bond1 (unregistering): Released all slaves
bond2 (unregistering): Released all slaves
bond3 (unregistering): Released all slaves
tipc: Disabling bearer
tipc: Left network mode
hsr_slave_0: left promiscuous mode
hsr_slave_1: left promiscuous mode
veth1_macvtap: left promiscuous mode
veth0_macvtap: left promiscuous mode
veth1_vlan: left promiscuous mode
veth0_vlan: left promiscuous mode
team0 (unregistering): Port device team_slave_1 removed
team0 (unregistering): Port device team_slave_0 removed
IPVS: stop unused estimator thread 0...
bond10: (slave ip6gretap1): failed to get link speed/duplex
bond10: (slave ip6gretap1): failed to get link speed/duplex