]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
vhost_net: stop device during reset owner
authorJason Wang <jasowang@redhat.com>
Thu, 25 Jan 2018 14:03:52 +0000 (22:03 +0800)
committerSeth Forshee <seth.forshee@canonical.com>
Tue, 13 Feb 2018 13:30:21 +0000 (07:30 -0600)
BugLink: http://bugs.launchpad.net/bugs/1749191
[ Upstream commit 4cd879515d686849eec5f718aeac62a70b067d82 ]

We don't stop device before reset owner, this means we could try to
serve any virtqueue kick before reset dev->worker. This will result a
warn since the work was pending at llist during owner resetting. Fix
this by stopping device during owner reset.

Reported-by: syzbot+eb17c6162478cc50632c@syzkaller.appspotmail.com
Fixes: 3a4d5c94e9593 ("vhost_net: a kernel-level virtio server")
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: Seth Forshee <seth.forshee@canonical.com>
drivers/vhost/net.c

index c7bdeb6556469efb93e2a6a7e742da3a37ad7e69..5636c7ca8ebac2aa92c0c43d3187f01d920d786e 100644 (file)
@@ -1208,6 +1208,7 @@ static long vhost_net_reset_owner(struct vhost_net *n)
        }
        vhost_net_stop(n, &tx_sock, &rx_sock);
        vhost_net_flush(n);
+       vhost_dev_stop(&n->dev);
        vhost_dev_reset_owner(&n->dev, umem);
        vhost_net_vq_reset(n);
 done: