From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:55052) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T4pyf-0006T0-79 for qemu-devel@nongnu.org; Fri, 24 Aug 2012 05:14:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T4pyX-0008WR-KX for qemu-devel@nongnu.org; Fri, 24 Aug 2012 05:14:53 -0400 Received: from mx1.redhat.com ([209.132.183.28]:34169) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T4pyX-0008WN-Ax for qemu-devel@nongnu.org; Fri, 24 Aug 2012 05:14:45 -0400 Message-ID: <503745F9.2020709@redhat.com> Date: Fri, 24 Aug 2012 11:14:33 +0200 From: Paolo Bonzini MIME-Version: 1.0 References: <1345537427-21601-1-git-send-email-mc@linux.vnet.ibm.com> <50334B51.6050900@redhat.com> <503357B2.5040901@linux.vnet.ibm.com> <50335F78.1030005@redhat.com> <5034BCD1.9020603@linux.vnet.ibm.com> <5034CBF8.3050602@redhat.com> <20120822131348.GA3512@stefanha-thinkpad.localdomain> <5034E918.4030305@redhat.com> <5035F873.6090305@linux.vnet.ibm.com> <5035FFF4.4040603@redhat.com> <1345769101.10190.124.camel@haakon2.linux-iscsi.org> <503733A2.1050300@redhat.com> <50375AD6.8060203@suse.de> In-Reply-To: <50375AD6.8060203@suse.de> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 1/2 v1] blkdrv: Add queue limits parameters for sg block drive List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Hannes Reinecke Cc: Stefan Hajnoczi , zwanp@cn.ibm.com, linuxram@us.ibm.com, qemu-devel@nongnu.org, "Nicholas A. Bellinger" , virtualization@lists.linux-foundation.org, Cong Meng , Christoph Hellwig Il 24/08/2012 12:43, Hannes Reinecke ha scritto: > Hehe. So finally someone else stumbled across this one. > > All is fine and dandy as long as you're able to use scsi-disk. > As soon as you're forced to use scsi-generic we're in trouble. > > With scsi-generic we actually have two problems: > 1) scsi-generic just acts as a pass-through and passes the commands > as-is, including the scatter-gather information as formatted by > the guest. So the guest could easily format an SG_IO comand > which will not be compatible with the host. > 2) The host is not able to differentiate between a malformed > SG_IO command and a real I/O error; in both cases it'll return > -EIO. > > So we can fix this by either > a) ignore (as we do nowadays :-) > b) Fixup scsi-generic to inspect and modify SG_IO information > to ensure the host-limits are respected That's what scsi-block already does. Perhaps sooner or later we will need a scsi-tape? That would be fine. > Yes, it's painful. But in the long run we'll have to do an SG_IO > inspection anyway, otherwise we'll always be susceptible to malicious > SG_IO attacks. I would like to do this in the kernel using BPF. I posted a possible spec at http://www.redhat.com/archives/libvir-list/2012-June/msg00505.html but the response was, ehm, underwhelming. Paolo