Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2480584imm; Thu, 7 Jun 2018 11:18:05 -0700 (PDT) X-Google-Smtp-Source: ADUXVKL52klWpnjwE4+fElY+XD+Xup5HDBYjvrxaVM15bK3qgPAyRYFaatYjf4iYzYv1UYP0EzrH X-Received: by 2002:a17:902:8ec2:: with SMTP id x2-v6mr3075821plo.370.1528395485278; Thu, 07 Jun 2018 11:18:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528395485; cv=none; d=google.com; s=arc-20160816; b=PGPQ2vYRSWaXR3xoA+hguqw9nhOB/KM9l87G5n2Hng9masepJjYu63EMEMpVz6eNNr SpB7/TTcukNZonrz+1LBwumtpdS9e4QNn6d7j3uOhYwKPdw/crNHrGGMc2PvSfvSdY3+ zw7e33IWgZccntF0iWXZ5gU31GjMd0hp1qEVXO3iZej/eYfKyyyx0oH0FgSghzg9JkZX iNShlQdgTLRDlQz51UtXVokxj+c1vJzNRTQSSHMWWtnVISg1LZBozt4u+7N5Ui0+fsTL 9Fn1/LmebfWVFpuL5dg0QQXGGThaoRIqwM6rqfDvls16aWYuXHj9ZK1k4cY2/py6YPAC vw+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:subject:message-id:date:cc:to :from:mime-version:content-transfer-encoding:content-disposition :arc-authentication-results; bh=eUTMd9XuwojW7RPQA6tA+Vu2EWGJMy9lWzAxHcg6Daw=; b=q7+27pSmzi0Gafc60F+zXeBkZsgrn7abou8vOF6Wniw6pkFc4/V+pW4+rNWQ/GCvnZ TAF8MK1Kz86bS3wC3+udzEgujw9IOQoitVb2bbzFOqfvzhzv6tl1qzvAD1jDW606Kr5d tRUs0+AKPsEsH9o7qA71gQSjuUT61VoOoXPm5k0n6nBt1JT+SXjHtDjX+A2K3xBwC6fp YF1npTLbIDLvsLP9h3hC7SB1DTwAUfmAYD5aR6pVX5dzQynCT61FOxBHGYQ3LzwT9yzK ad6sClJjzIPi2LXWe6LEZSaIaGHog02ydzqr+fNHn2gBHNb8E8yEJ8yscagLXbwlEVt+ tFgw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t20-v6si53600861plo.326.2018.06.07.11.17.34; Thu, 07 Jun 2018 11:18:05 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935684AbeFGO72 (ORCPT + 99 others); Thu, 7 Jun 2018 10:59:28 -0400 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:41270 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935662AbeFGO7Z (ORCPT ); Thu, 7 Jun 2018 10:59:25 -0400 Received: from [148.252.241.226] (helo=deadeye) by shadbolt.decadent.org.uk with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1fQvbk-0005hK-4Y; Thu, 07 Jun 2018 15:09:44 +0100 Received: from ben by deadeye with local (Exim 4.91) (envelope-from ) id 1fQvb4-0002xW-N9; Thu, 07 Jun 2018 15:09:02 +0100 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 From: Ben Hutchings To: linux-kernel@vger.kernel.org, stable@vger.kernel.org CC: akpm@linux-foundation.org, syzbot+eb17c6162478cc50632c@syzkaller.appspotmail.com, "Jason Wang" , "David S. Miller" Date: Thu, 07 Jun 2018 15:05:21 +0100 Message-ID: X-Mailer: LinuxStableQueue (scripts by bwh) Subject: [PATCH 3.16 176/410] vhost_net: stop device during reset owner In-Reply-To: X-SA-Exim-Connect-IP: 148.252.241.226 X-SA-Exim-Mail-From: ben@decadent.org.uk X-SA-Exim-Scanned: No (on shadbolt.decadent.org.uk); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.16.57-rc1 review patch. If anyone has any objections, please let me know. ------------------ From: Jason Wang commit 4cd879515d686849eec5f718aeac62a70b067d82 upstream. 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 [bwh: Backported to 3.16: adjust context] Signed-off-by: Ben Hutchings --- drivers/vhost/net.c | 1 + 1 file changed, 1 insertion(+) --- a/drivers/vhost/net.c +++ b/drivers/vhost/net.c @@ -1009,6 +1009,7 @@ static long vhost_net_reset_owner(struct } vhost_net_stop(n, &tx_sock, &rx_sock); vhost_net_flush(n); + vhost_dev_stop(&n->dev); vhost_dev_reset_owner(&n->dev, memory); vhost_net_vq_reset(n); done: