All of lore.kernel.org
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: Jeff Cody <jcody@redhat.com>
Cc: kwolf@redhat.com, qemu-devel@nongnu.org, stefanha@redhat.com
Subject: Re: [Qemu-devel] [PATCH] block: vhdx - fix reading beyond pointer during image creation
Date: Thu, 18 Sep 2014 09:43:14 +0200	[thread overview]
Message-ID: <87fvfpidbh.fsf@blackfin.pond.sub.org> (raw)
In-Reply-To: <87a95xl91h.fsf@blackfin.pond.sub.org> (Markus Armbruster's message of "Thu, 18 Sep 2014 08:47:22 +0200")

Markus Armbruster <armbru@redhat.com> writes:

> Jeff Cody <jcody@redhat.com> writes:
>
>> On Wed, Sep 17, 2014 at 08:33:10AM +0200, Markus Armbruster wrote:
>>> Jeff Cody <jcody@redhat.com> 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 <jcody@redhat.com>
>>> > ---
>>> >  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 <armbru@redhat.com>

Just in case you actually *like* hanging your code right off the right
margin of the window.  *Shudder*  ;-P

  reply	other threads:[~2014-09-18  7:43 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-16 19:12 [Qemu-devel] [PATCH] block: vhdx - fix reading beyond pointer during image creation Jeff Cody
2014-09-17  6:33 ` Markus Armbruster
2014-09-17 19:54   ` Jeff Cody
2014-09-18  6:47     ` Markus Armbruster
2014-09-18  7:43       ` Markus Armbruster [this message]
2014-09-19  9:45 ` Stefan Hajnoczi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87fvfpidbh.fsf@blackfin.pond.sub.org \
    --to=armbru@redhat.com \
    --cc=jcody@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=stefanha@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.