From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=49186 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Otgzq-0003r8-SF for qemu-devel@nongnu.org; Thu, 09 Sep 2010 09:17:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Otgzl-0003pL-Ot for qemu-devel@nongnu.org; Thu, 09 Sep 2010 09:16:58 -0400 Received: from mail-gw0-f45.google.com ([74.125.83.45]:33399) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Otgzl-0003pH-IZ for qemu-devel@nongnu.org; Thu, 09 Sep 2010 09:16:53 -0400 Received: by gwb11 with SMTP id 11so675995gwb.4 for ; Thu, 09 Sep 2010 06:16:53 -0700 (PDT) Message-ID: <4C88DE41.8010503@codemonkey.ws> Date: Thu, 09 Sep 2010 08:16:49 -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> <4C88D881.4020303@codemonkey.ws> <4C88DAE0.4050301@redhat.com> In-Reply-To: <4C88DAE0.4050301@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 08:02 AM, Kevin Wolf wrote: >>> 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. >> > That doesn't help any of the other use cases. Either we consider it a > problem or not. If we do, it must be fixed everywhere. > Yes, it's a problem. In other places in the code base, we go to incredible lengths to avoid unbounded allocations. I think we have to two choices: 1) refactor all of the code to not require qemu_iovec_to_buffer() or 2) cap the request size and fail a request if it's greater. Regards, Anthony Liguori > Kevin >