From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=46976 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Otgc3-0003vN-6L for qemu-devel@nongnu.org; Thu, 09 Sep 2010 08:52:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Otgc2-0008Mp-3b for qemu-devel@nongnu.org; Thu, 09 Sep 2010 08:52:23 -0400 Received: from mail-iw0-f173.google.com ([209.85.214.173]:46410) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Otgc1-0008Mf-VA for qemu-devel@nongnu.org; Thu, 09 Sep 2010 08:52:22 -0400 Received: by iwn38 with SMTP id 38so1147268iwn.4 for ; Thu, 09 Sep 2010 05:52:21 -0700 (PDT) Message-ID: <4C88D881.4020303@codemonkey.ws> Date: Thu, 09 Sep 2010 07:52:17 -0500 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH] raw: Fix image header protection References: <1283861325-23785-1-git-send-email-kwolf@redhat.com> <4C88D381.5030306@codemonkey.ws> <4C88D6A3.6050001@redhat.com> In-Reply-To: <4C88D6A3.6050001@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: qemu-devel@nongnu.org On 09/09/2010 07:44 AM, Kevin Wolf wrote: >> Isn't this an unbounded, guest controlled, malloc? IOW, a guest could >> do a request of 4GB and on a 32-bit system crash the qemu instance. >> > If you're concerned about that, we need to ban qemu_iovec_to_buffer() > completely. Currently we do the same thing for every write request for > every format but raw. And QED ;-) > Or instead of completely removing it, we could add > a size limit, though I suspect that would mean violating some specs. > One thing I was thinking of trying was splitting off the first sector into a linear buffer, then allocating a new iovec and adjusting the new iovec to cover the new request minus the first sector. > If I was a guest though and wanted to crash qemu, I would just mess up > the virtio ring a bit so that qemu would exit() voluntarily. ;-) > Yeah, we're terrible at this but we should try to avoid making things worse. Particularly in a code path (like raw images) where we don't have this problem today. Regards, Anthony Liguori > Kevin >