virtio-net: set queues after driver_ok
stable inclusion from stable-v5.10.192 commit 9aead733f5e0d40e3d2798f4d2fd4a5d7930111c category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I933RF Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=9aead733f5e0d40e3d2798f4d2fd4a5d7930111c -------------------------------- commit 51b81317 upstream. Commit 25266128 ("virtio-net: fix race between set queues and probe") tries to fix the race between set queues and probe by calling _virtnet_set_queues() before DRIVER_OK is set. This violates virtio spec. Fixing this by setting queues after virtio_device_ready(). Note that rtnl needs to be held for userspace requests to change the number of queues. So we are serialized in this way. Fixes: 25266128 ("virtio-net: fix race between set queues and probe") Reported-by:Dragos Tatulea <dtatulea@nvidia.com> Acked-by:
Michael S. Tsirkin <mst@redhat.com> Signed-off-by:
Jason Wang <jasowang@redhat.com> Signed-off-by:
David S. Miller <davem@davemloft.net> Signed-off-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by:
sanglipeng <sanglipeng1@jd.com>
Loading
Please sign in to comment