Commit 2baedca6 authored by Jason Wang's avatar Jason Wang Committed by Yongqiang Liu
Browse files

virtio-net: set queues after driver_ok

stable inclusion
from stable-v4.19.293
commit 834c99d99f7eaf63485ea3c5da8e8293f648b4f7
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I7ZELT


CVE: NA

--------------------------------

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: default avatarDragos Tatulea <dtatulea@nvidia.com>
Acked-by: default avatarMichael S. Tsirkin <mst@redhat.com>
Signed-off-by: default avatarJason Wang <jasowang@redhat.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarYongqiang Liu <liuyongqiang13@huawei.com>
parent 9c03a6cf
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment