Skip to content

Commit be5dcae

Browse files
plxtykuba-moo
authored andcommitted
virtio-net: fix recursived rtnl_lock() during probe()
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 <[email protected]> Acked-by: Michael S. Tsirkin <[email protected]> Acked-by: Jason Wang <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent ad4f6df commit be5dcae

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
@@ -7059,7 +7059,7 @@ static int virtnet_probe(struct virtio_device *vdev)
70597059
otherwise get link status from config. */
70607060
netif_carrier_off(dev);
70617061
if (virtio_has_feature(vi->vdev, VIRTIO_NET_F_STATUS)) {
7062-
virtnet_config_changed_work(&vi->config_work);
7062+
virtio_config_changed(vi->vdev);
70637063
} else {
70647064
vi->status = VIRTIO_NET_S_LINK_UP;
70657065
virtnet_update_settings(vi);

0 commit comments

Comments
 (0)