[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-block] [PATCH v2 4/6] luks: Turn invalid assertion into check
From: |
Daniel P . Berrangé |
Subject: |
Re: [Qemu-block] [PATCH v2 4/6] luks: Turn invalid assertion into check |
Date: |
Mon, 12 Mar 2018 16:03:46 +0000 |
User-agent: |
Mutt/1.9.2 (2017-12-15) |
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 file is too small for the payload offset.
>
> Zero length images are fine, so trigger -EIO only on offset > len, not
> on offset >= len as the assertion did before.
>
> Signed-off-by: Kevin Wolf <address@hidden>
> ---
> block/crypto.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
Reviewed-by: Daniel P. Berrangé <address@hidden>
Regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
- [Qemu-block] [PATCH v2 0/6] luks: Implement .bdrv_co_create, Kevin Wolf, 2018/03/12
- [Qemu-block] [PATCH v2 1/6] luks: Separate image file creation from formatting, Kevin Wolf, 2018/03/12
- [Qemu-block] [PATCH v2 2/6] luks: Create block_crypto_co_create_generic(), Kevin Wolf, 2018/03/12
- [Qemu-block] [PATCH v2 5/6] luks: Catch integer overflow for huge sizes, Kevin Wolf, 2018/03/12
- [Qemu-block] [PATCH v2 4/6] luks: Turn invalid assertion into check, Kevin Wolf, 2018/03/12
- Re: [Qemu-block] [PATCH v2 4/6] luks: Turn invalid assertion into check,
Daniel P . Berrangé <=
- [Qemu-block] [PATCH v2 6/6] qemu-iotests: Test luks QMP image creation, Kevin Wolf, 2018/03/12
- [Qemu-block] [PATCH v2 3/6] luks: Support .bdrv_co_create, Kevin Wolf, 2018/03/12
- Re: [Qemu-block] [PATCH v2 0/6] luks: Implement .bdrv_co_create, Kevin Wolf, 2018/03/12
- Re: [Qemu-block] [Qemu-devel] [PATCH v2 0/6] luks: Implement .bdrv_co_create, no-reply, 2018/03/12