[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-block] [PATCH v3 08/18] qcow: make encrypt_sectors encrypt in
From: |
Daniel P. Berrange |
Subject: |
Re: [Qemu-block] [PATCH v3 08/18] qcow: make encrypt_sectors encrypt in place |
Date: |
Fri, 10 Feb 2017 16:19:14 +0000 |
User-agent: |
Mutt/1.7.1 (2016-10-04) |
On Fri, Feb 10, 2017 at 11:44:15AM +0100, Alberto Garcia wrote:
> On Thu 26 Jan 2017 11:18:17 AM CET, Daniel P. Berrange wrote:
> > Instead of requiring separate input/output buffers for
> > encrypting data, change encrypt_sectors() to assume
> > use of a single buffer, encrypting in place. One current
> > caller uses the same buffer for input/output already
> > and the other two callers are easily converted to do so.
> >
> > Signed-off-by: Daniel P. Berrange <address@hidden>
>
> Reviewed-by: Alberto Garcia <address@hidden>
>
> > @@ -469,13 +465,12 @@ static uint64_t get_cluster_offset(BlockDriverState
> > *bs,
> > uint64_t start_sect;
> > assert(s->cipher);
> > start_sect = (offset & ~(s->cluster_size - 1)) >> 9;
> > - memset(s->cluster_data + 512, 0x00, 512);
>
> I haven't checked this thoroughly, but without this patch it seems that
> this would overflow if the cluster size is 512 bytes (the minimum
> allowed by qcow).
Heh, yeah, I think you are right :-)
Regards,
Daniel
--
|: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org -o- http://virt-manager.org :|
|: http://entangle-photo.org -o- http://search.cpan.org/~danberr/ :|