From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58185) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XUWNF-0004BG-If for qemu-devel@nongnu.org; Thu, 18 Sep 2014 03:43:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XUWN9-0008QE-5x for qemu-devel@nongnu.org; Thu, 18 Sep 2014 03:43:29 -0400 Received: from mx1.redhat.com ([209.132.183.28]:6593) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XUWN8-0008OF-Tg for qemu-devel@nongnu.org; Thu, 18 Sep 2014 03:43:23 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s8I7hHXu020725 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Thu, 18 Sep 2014 03:43:17 -0400 From: Markus Armbruster References: <1410894726-21836-1-git-send-email-jcody@redhat.com> <87y4tiu57d.fsf@blackfin.pond.sub.org> <20140917195418.GB3813@localhost.localdomain> <87a95xl91h.fsf@blackfin.pond.sub.org> Date: Thu, 18 Sep 2014 09:43:14 +0200 In-Reply-To: <87a95xl91h.fsf@blackfin.pond.sub.org> (Markus Armbruster's message of "Thu, 18 Sep 2014 08:47:22 +0200") Message-ID: <87fvfpidbh.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 Markus Armbruster writes: > 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!" :) Forgot to say: since checkpatch is happy, I guess this is a technically a matter of taste, so Reviewed-by: Markus Armbruster Just in case you actually *like* hanging your code right off the right margin of the window. *Shudder* ;-P