From: Jason Wang Date: Thu, 25 Jan 2018 14:03:52 +0000 (+0800) Subject: vhost_net: stop device during reset owner X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=b9b70c876a7a73d494cb9d9f32a227dcfac54a4c;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git vhost_net: stop device during reset owner [ 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 Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c index bd15309ac5f1..082891dffd9d 100644 --- a/drivers/vhost/net.c +++ b/drivers/vhost/net.c @@ -1212,6 +1212,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: