Received: by 10.192.165.148 with SMTP id m20csp4988578imm; Tue, 24 Apr 2018 11:42:51 -0700 (PDT) X-Google-Smtp-Source: AIpwx48OAS0YjckwXoDPT/a3Mez+1g0o/tiDApcs1ydykoRD3Vg2D2RyVgwmXkzW+c8enRgochgd X-Received: by 10.101.93.140 with SMTP id f12mr21657532pgt.412.1524595371440; Tue, 24 Apr 2018 11:42:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524595371; cv=none; d=google.com; s=arc-20160816; b=uVJYiVETpQrYoBSvWJzv8t8mVv9RXO11H/JcKe6otzza7T3oeYMnvcgoR6YlWalfeA FdMe1aOK+HFHuQXSRZfJfIkSlGdCE3slPXpgmdKXqz/k6jUnuyOgIeCa55COGP12cDko YoJfYQZWXwqJVUcH/B39enCA8GWqE2Y3Z+UHgeF0q6zNJ8PBXfTRKLrbs9ptBm6puitU fz1/UQjKC9n1tWHTC7ZXvSroWDXCPUJPb9jXCri6eDf6LQaywhi490BTYbASczhd58kq nQHWBKCL8WwFEmF1bPYjin6SzpLcLll5msJN4iMwgkmXtxqSB3zfMYzXCzIw8qvrmdBR Uv0Q== 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:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :arc-authentication-results; bh=15ZfaUiucTR+c8Oddf52N2P819/vJO3A6WZb/6XgZB8=; b=W3rio9+LD8A/OhEmxVniewsw0s3JwMe5eaY4epZjoxWQ0N71wmW2B6T1HPJqo7eCYZ dqxqOSsk6ecjnDf4Gt56zpL4/z/EtztGdho7TMRR7QVk6Q7tVZWs+FiObGYC3iNnQwYI H4apcsfCg/FgXi4/Afc84GQ7mKHKlSC+jRpMRBXZto2Mh6Xuwoz/p8ISkTkxv7xjjhYd zwJwznbhfZ090fF3ckjzBFzYmNRcvlOuGOyTCBa7rfvoqB+yBEypPakCYx6N/H7Q5D80 Z6qM/cA9/UXxgstar7RRe3DY9fgCn4CpnPUzDBiyKR27WSdPKvqjldxhpBw4ZgivrcYe qrrA== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b6-v6si14413322plm.202.2018.04.24.11.42.37; Tue, 24 Apr 2018 11:42:51 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751300AbeDXSlc (ORCPT + 99 others); Tue, 24 Apr 2018 14:41:32 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:60264 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750766AbeDXSla (ORCPT ); Tue, 24 Apr 2018 14:41:30 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.rdu2.redhat.com [10.11.54.6]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 26333FB67F; Tue, 24 Apr 2018 18:41:30 +0000 (UTC) Received: from redhat.com (ovpn-123-127.rdu2.redhat.com [10.10.123.127]) by smtp.corp.redhat.com (Postfix) with SMTP id 92F002166BC6; Tue, 24 Apr 2018 18:41:29 +0000 (UTC) Date: Tue, 24 Apr 2018 21:41:29 +0300 From: "Michael S. Tsirkin" To: linux-kernel@vger.kernel.org Cc: Amit Shah , Arnd Bergmann , Greg Kroah-Hartman , virtualization@lists.linux-foundation.org, stable@vger.kernel.org, Tiwei Bie , Jason Wang Subject: Re: [PATCH 0/6] virtio-console: spec compliance fixes Message-ID: <20180424214104-mutt-send-email-mst@kernel.org> References: <1524248223-393618-1-git-send-email-mst@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1524248223-393618-1-git-send-email-mst@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.6 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Tue, 24 Apr 2018 18:41:30 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.1]); Tue, 24 Apr 2018 18:41:30 +0000 (UTC) for IP:'10.11.54.6' DOMAIN:'int-mx06.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'mst@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 20, 2018 at 09:17:59PM +0300, Michael S. Tsirkin wrote: > Turns out virtio console tries to take a buffer out of an active vq. > Works by sheer luck, and is explicitly forbidden by spec. And while > going over it I saw that error handling is also broken - > failure is easy to trigger if I force allocations to fail. > > Lightly tested. Amit - any feedback before I push these patches? > Michael S. Tsirkin (6): > virtio_console: don't tie bufs to a vq > virtio: add ability to iterate over vqs > virtio_console: free buffers after reset > virtio_console: drop custom control queue cleanup > virtio_console: move removal code > virtio_console: reset on out of memory > > drivers/char/virtio_console.c | 155 ++++++++++++++++++++---------------------- > include/linux/virtio.h | 3 + > 2 files changed, 75 insertions(+), 83 deletions(-) > > -- > MST >