Skip to content

Commit 4e7c463

Browse files
plxtygregkh
authored andcommitted
virtio-net: fix recursived rtnl_lock() during probe()
[ Upstream commit be5dcae ] The deadlock appears in a stack trace like: virtnet_probe() rtnl_lock() virtio_config_changed_work() netdev_notify_peers() rtnl_lock() It happens if the VMM sends a VIRTIO_NET_S_ANNOUNCE request while the virtio-net driver is still probing. The config_work in probe() will get scheduled until virtnet_open() enables the config change notification via virtio_config_driver_enable(). Fixes: df28de7 ("virtio-net: synchronize operstate with admin state on up/down") Signed-off-by: Zigit Zo <zuozhijie@bytedance.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> Acked-by: Jason Wang <jasowang@redhat.com> Link: https://patch.msgid.link/20250716115717.1472430-1-zuozhijie@bytedance.com Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 1a71bf5 commit 4e7c463

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/net/virtio_net.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6802,7 +6802,7 @@ static int virtnet_probe(struct virtio_device *vdev)
68026802
otherwise get link status from config. */
68036803
netif_carrier_off(dev);
68046804
if (virtio_has_feature(vi->vdev, VIRTIO_NET_F_STATUS)) {
6805-
virtnet_config_changed_work(&vi->config_work);
6805+
virtio_config_changed(vi->vdev);
68066806
} else {
68076807
vi->status = VIRTIO_NET_S_LINK_UP;
68086808
virtnet_update_settings(vi);

0 commit comments

Comments
 (0)