Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 713a98d9 authored by Jason Wang's avatar Jason Wang Committed by David S. Miller
Browse files

virtio-net: serialize tx routine during reset



We don't hold any tx lock when trying to disable TX during reset, this
would lead a use after free since ndo_start_xmit() tries to access
the virtqueue which has already been freed. Fix this by using
netif_tx_disable() before freeing the vqs, this could make sure no tx
after vq freeing.

Reported-by: default avatarJean-Philippe Menil <jpmenil@gmail.com>
Tested-by: default avatarJean-Philippe Menil <jpmenil@gmail.com>
Fixes commit f600b690 ("virtio_net: Add XDP support")
Cc: John Fastabend <john.fastabend@gmail.com>
Signed-off-by: default avatarJason Wang <jasowang@redhat.com>
Acked-by: default avatarMichael S. Tsirkin <mst@redhat.com>
Acked-by: default avatarRobert McCabe <robert.mccabe@rockwellcollins.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent e20bd60b
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -1797,6 +1797,7 @@ static void virtnet_freeze_down(struct virtio_device *vdev)
	flush_work(&vi->config_work);

	netif_device_detach(vi->dev);
	netif_tx_disable(vi->dev);
	cancel_delayed_work_sync(&vi->refill);

	if (netif_running(vi->dev)) {