From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45070) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bhvBJ-0004Y9-8J for qemu-devel@nongnu.org; Thu, 08 Sep 2016 04:59:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bhvBF-0002wc-9B for qemu-devel@nongnu.org; Thu, 08 Sep 2016 04:59:37 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:59375 helo=mx0a-001b2d01.pphosted.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bhvBF-0002wY-3B for qemu-devel@nongnu.org; Thu, 08 Sep 2016 04:59:33 -0400 Received: from pps.filterd (m0098420.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.17/8.16.0.17) with SMTP id u888wcLE042282 for ; Thu, 8 Sep 2016 04:59:32 -0400 Received: from e06smtp07.uk.ibm.com (e06smtp07.uk.ibm.com [195.75.94.103]) by mx0b-001b2d01.pphosted.com with ESMTP id 25ataxxcpv-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Thu, 08 Sep 2016 04:59:32 -0400 Received: from localhost by e06smtp07.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 8 Sep 2016 09:59:30 +0100 Received: from b06cxnps4074.portsmouth.uk.ibm.com (d06relay11.portsmouth.uk.ibm.com [9.149.109.196]) by d06dlp02.portsmouth.uk.ibm.com (Postfix) with ESMTP id 52A952190046 for ; Thu, 8 Sep 2016 09:58:50 +0100 (BST) Received: from d06av11.portsmouth.uk.ibm.com (d06av11.portsmouth.uk.ibm.com [9.149.37.252]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u888xSbk17826174 for ; Thu, 8 Sep 2016 08:59:28 GMT Received: from d06av11.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av11.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id u888xRxK032580 for ; Thu, 8 Sep 2016 02:59:28 -0600 Date: Thu, 8 Sep 2016 10:59:26 +0200 From: Cornelia Huck In-Reply-To: <147326876478.8546.16045138068342092499.stgit@bahia.lan> References: <147326875705.8546.11347276277137015855.stgit@bahia.lan> <147326876478.8546.16045138068342092499.stgit@bahia.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-Id: <20160908105926.0d968e64.cornelia.huck@de.ibm.com> Subject: Re: [Qemu-devel] [PATCH 1/2] virtio-9p: print error message and exit instead of BUG_ON() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Greg Kurz Cc: "Michael S. Tsirkin" , qemu-devel@nongnu.org, "Aneesh Kumar K.V" On Wed, 07 Sep 2016 19:19:24 +0200 Greg Kurz wrote: > Calling assert() really makes sense when hitting a genuine bug, which calls > for a fix in QEMU. However, when something goes wrong because the guest > sends a malformed message, it is better to write down a more meaningul > error message and exit. > > Signed-off-by: Greg Kurz > --- > hw/9pfs/virtio-9p-device.c | 20 ++++++++++++++++++-- > 1 file changed, 18 insertions(+), 2 deletions(-) While this is an improvement over the current state, I don't think the guest should be able to kill qemu just by doing something stupid. The right way to go is to mark the virtio device as broken and stop doing any processing until the guest resets it. I think Stefan had a patch series doing that for some base virtio errors, but I'd have to search for it.