Received: from eggs.gnu.org ([209.51.188.92]:40953) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hH4aD-0003oX-2p for qemu-devel@nongnu.org; Thu, 18 Apr 2019 06:48:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hH4a9-0003QT-Aa for qemu-devel@nongnu.org; Thu, 18 Apr 2019 06:47:55 -0400 Date: Thu, 18 Apr 2019 12:47:37 +0200 From: Kevin Wolf Message-ID: <20190418104737.GC5242@linux.fritz.box> References: <20190417115343.30527-1-pbonzini@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] [Qemu-block] [PATCH] scsi-generic: prevent guest from exceeding SG_IO limits List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Paolo Bonzini Cc: Stefan Hajnoczi , Stefan Hajnoczi , qemu-devel , qemu block , qemu-stable Am 18.04.2019 um 11:48 hat Paolo Bonzini geschrieben: > On 17/04/19 14:30, Stefan Hajnoczi wrote: > > On Wed, Apr 17, 2019 at 12:54 PM Paolo Bonzini wrote: > >> Linux places a limit of UIO_MAXIOV pages on SG_IO ioctls (and if the limit > >> is exceeded, a confusing ENOMEM error is returned[1]). Prevent the guest > >> from exceeding these limits, by capping the maximum transfer length to > >> that value in the block limits VPD page. > >> > >> [1] Oh well, at least it was easier to follow the kernel source knowing > >> it had to end as ENOMEM... > >> > >> Cc: qemu-stable@nongnu.org > >> Cc: qemu-block@nongnu.org > >> Cc: Stefan Hajnoczi > >> Signed-off-by: Paolo Bonzini > >> --- > >> hw/scsi/scsi-generic.c | 17 +++++++++++++---- > >> 1 file changed, 13 insertions(+), 4 deletions(-) > > > > Reviewed-by: Stefan Hajnoczi > > > > This is acually only an issue with kernels prior to 4.5, so it should be > fixed downstream instead. I don't think that upstream QEMU has kernels > 4.5 as an official requirement, though? We try to be compatible with quite old libs, so we should stay compatible with old kernels, too. Kevin