summaryrefslogtreecommitdiffstats
path: root/drivers/vhost
diff options
context:
space:
mode:
authorJason Wang <jasowang@redhat.com>2018-01-25 22:03:52 +0800
committerDavid S. Miller <davem@davemloft.net>2018-01-29 12:26:20 -0500
commit4cd879515d686849eec5f718aeac62a70b067d82 (patch)
tree8877aa0e26df62b6f4d62a6f7553a0c3fb9e648a /drivers/vhost
parente8368d9ebb9413ee9c24c91f0a48d39c764c242c (diff)
downloadlinux-4cd879515d686849eec5f718aeac62a70b067d82.tar.gz
linux-4cd879515d686849eec5f718aeac62a70b067d82.tar.bz2
linux-4cd879515d686849eec5f718aeac62a70b067d82.zip
vhost_net: stop device during reset owner
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>
Diffstat (limited to 'drivers/vhost')
-rw-r--r--drivers/vhost/net.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c
index 7baa90abe097..80323948c0dd 100644
--- a/drivers/vhost/net.c
+++ b/drivers/vhost/net.c
@@ -1227,6 +1227,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: