[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: |
Alberto Garcia |
Subject: |
Re: [Qemu-block] [PATCH v3 08/18] qcow: make encrypt_sectors encrypt in place |
Date: |
Fri, 10 Feb 2017 11:44:15 +0100 |
User-agent: |
Notmuch/0.18.2 (http://notmuchmail.org) Emacs/24.4.1 (i586-pc-linux-gnu) |
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).
Berto