Commit 711df717 authored by Jason Wang's avatar Jason Wang Committed by Greg Kroah-Hartman

vhost_net: stop device during reset owner


[ Upstream commit 4cd87951 ]

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: 3a4d5c94 ("vhost_net: a kernel-level virtio server")
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>
parent 117991ed
...@@ -981,6 +981,7 @@ static long vhost_net_reset_owner(struct vhost_net *n) ...@@ -981,6 +981,7 @@ static long vhost_net_reset_owner(struct vhost_net *n)
} }
vhost_net_stop(n, &tx_sock, &rx_sock); vhost_net_stop(n, &tx_sock, &rx_sock);
vhost_net_flush(n); vhost_net_flush(n);
vhost_dev_stop(&n->dev);
vhost_dev_reset_owner(&n->dev, memory); vhost_dev_reset_owner(&n->dev, memory);
vhost_net_vq_reset(n); vhost_net_vq_reset(n);
done: done:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment