From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:52259) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1evPva-0007X4-IT for qemu-devel@nongnu.org; Mon, 12 Mar 2018 12:03:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1evPvZ-0003gj-IM for qemu-devel@nongnu.org; Mon, 12 Mar 2018 12:03:58 -0400 Date: Mon, 12 Mar 2018 16:03:46 +0000 From: Daniel =?utf-8?B?UC4gQmVycmFuZ8Op?= Message-ID: <20180312160346.GH3493@redhat.com> Reply-To: Daniel =?utf-8?B?UC4gQmVycmFuZ8Op?= References: <20180312150218.1314-1-kwolf@redhat.com> <20180312150218.1314-5-kwolf@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20180312150218.1314-5-kwolf@redhat.com> Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] [PATCH v2 4/6] luks: Turn invalid assertion into check List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf Cc: qemu-block@nongnu.org, mreitz@redhat.com, eblake@redhat.com, qemu-devel@nongnu.org On Mon, Mar 12, 2018 at 04:02:16PM +0100, Kevin Wolf wrote: > The .bdrv_getlength implementation of the crypto block driver asserted > that the payload offset isn't after EOF. This is an invalid assertion t= o > make as the image file could be corrupted. Instead, check it and return > -EIO if the file is too small for the payload offset. >=20 > Zero length images are fine, so trigger -EIO only on offset > len, not > on offset >=3D len as the assertion did before. >=20 > Signed-off-by: Kevin Wolf > --- > block/crypto.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) Reviewed-by: Daniel P. Berrang=C3=A9 Regards, Daniel --=20 |: https://berrange.com -o- https://www.flickr.com/photos/dberran= ge :| |: https://libvirt.org -o- https://fstop138.berrange.c= om :| |: https://entangle-photo.org -o- https://www.instagram.com/dberran= ge :|