Received: from eggs.gnu.org ([2001:4830:134:3::10]:49522) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XUVVB-0004j1-IF for qemu-devel@nongnu.org; Thu, 18 Sep 2014 02:47:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XUVV6-0003f6-40 for qemu-devel@nongnu.org; Thu, 18 Sep 2014 02:47:37 -0400 Received: from mx1.redhat.com ([209.132.183.28]:62607) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XUVV5-0003dS-Rw for qemu-devel@nongnu.org; Thu, 18 Sep 2014 02:47:32 -0400 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s8I6lP1R008106 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Thu, 18 Sep 2014 02:47:25 -0400 From: Markus Armbruster References: <1410894726-21836-1-git-send-email-jcody@redhat.com> <87y4tiu57d.fsf@blackfin.pond.sub.org> <20140917195418.GB3813@localhost.localdomain> Date: Thu, 18 Sep 2014 08:47:22 +0200 In-Reply-To: <20140917195418.GB3813@localhost.localdomain> (Jeff Cody's message of "Wed, 17 Sep 2014 15:54:18 -0400") Message-ID: <87a95xl91h.fsf@blackfin.pond.sub.org> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH] block: vhdx - fix reading beyond pointer during image creation List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jeff Cody Cc: kwolf@redhat.com, qemu-devel@nongnu.org, stefanha@redhat.com Jeff Cody writes: > On Wed, Sep 17, 2014 at 08:33:10AM +0200, Markus Armbruster wrote: >> Jeff Cody writes: >> >> > In vhdx_create_metadata(), we allocate 40 bytes to entry_buffer for >> > the various metadata table entries. However, we write out 64kB from >> > that buffer into the new file. Only write out the correct 40 bytes. >> > >> > Signed-off-by: Jeff Cody >> > --- >> > block/vhdx.c | 16 ++++++++-------- >> > 1 file changed, 8 insertions(+), 8 deletions(-) >> > >> > diff --git a/block/vhdx.c b/block/vhdx.c >> > index 796b7bd..b52ec32 100644 >> > --- a/block/vhdx.c >> > +++ b/block/vhdx.c >> > @@ -1407,6 +1407,12 @@ exit: >> > return ret; >> > } >> > >> > +#define VHDX_METADATA_ENTRY_BUFFER_SIZE \ >> > + (sizeof(VHDXFileParameters) +\ >> > + sizeof(VHDXVirtualDiskSize) +\ >> > + sizeof(VHDXPage83Data) +\ >> > + sizeof(VHDXVirtualDiskLogicalSectorSize) +\ >> > + sizeof(VHDXVirtualDiskPhysicalSectorSize)) >> >> Long lines, caused by excessive indentation. Emacs suggests >> >> #define VHDX_METADATA_ENTRY_BUFFER_SIZE \ >> (sizeof(VHDXFileParameters) + \ >> sizeof(VHDXVirtualDiskSize) + \ >> sizeof(VHDXPage83Data) + \ >> sizeof(VHDXVirtualDiskLogicalSectorSize) + \ >> sizeof(VHDXVirtualDiskPhysicalSectorSize)) >> > > So, I was getting ready to respin this, but double checked the patch - > it shows the lines ending on column 80 (as intended), and > checkpatch.pl had no issue with it. Did you accidentally (or > intentionally!) count the leading '+' of the patch itself? I didn't count anything, I trusted my eyes, which screamed "ugly!" :)