From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51678) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bhHYW-00019Z-Ev for qemu-devel@nongnu.org; Tue, 06 Sep 2016 10:40:57 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bhHYS-00012a-9r for qemu-devel@nongnu.org; Tue, 06 Sep 2016 10:40:56 -0400 Date: Tue, 6 Sep 2016 16:40:40 +0200 From: Kevin Wolf Message-ID: <20160906144040.GE4667@noname.redhat.com> References: <1473171997-11359-1-git-send-email-berrange@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1473171997-11359-1-git-send-email-berrange@redhat.com> Subject: Re: [Qemu-devel] [PATCH] qcow2: fix encryption during cow of sectors List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Daniel P. Berrange" Cc: qemu-devel@nongnu.org, qemu-block@nongnu.org, qemu-stable@nongnu.org Am 06.09.2016 um 16:26 hat Daniel P. Berrange geschrieben: > Broken in previous commit: > > commit aaa4d20b4972bb1a811ce929502e6741835d584e > Author: Kevin Wolf > Date: Wed Jun 1 15:21:05 2016 +0200 > > qcow2: Make copy_sectors() byte based > > The copy_sectors() code was originally using the 'sector' > parameter for encryption, which was passed in by the caller > from the QCowL2Meta.offset field (aka the guest logical > offset). > > After the change, the code is using 'cluster_offset' which > was passed in from QCow2L2Meta.alloc_offset field (aka the > host physical offset). > > This would cause the data to be encrypted using an incorrect > initialization vector which will in turn cause later reads > to return garbage. > > Although current qcow2 built-in encryption is blocked from > usage in the emulator, one could still hit this if writing > to the file via qemu-{img,io,nbd} commands. > > Signed-off-by: Daniel P. Berrange Cc: qemu-stable@nongnu.org Oops, thanks. Applied to the block branch. Kevin