Re: [Qemu-devel] [PATCH v2 4/6] luks: Turn invalid assertion into check

2018-03-12 Thread Daniel P . Berrangé
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 to > make as the image file could be corrupted. Instead, check it and return > -EIO if the

[Qemu-devel] [PATCH v2 4/6] luks: Turn invalid assertion into check

2018-03-12 Thread Kevin Wolf
The .bdrv_getlength implementation of the crypto block driver asserted that the payload offset isn't after EOF. This is an invalid assertion to make as the image file could be corrupted. Instead, check it and return -EIO if the file is too small for the payload offset. Zero length images are