[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 3/4] qcow2: Don't open images with header.refcou
From: |
Max Reitz |
Subject: |
Re: [Qemu-devel] [PATCH 3/4] qcow2: Don't open images with header.refcount_table_clusters == 0 |
Date: |
Thu, 2 Nov 2017 18:41:44 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 |
On 2017-11-01 16:42, Alberto Garcia wrote:
> qcow2_do_open() is checking that header.refcount_table_clusters is not
> too large, but it doesn't check that it's greater than zero. Apart
> from the fact that an image like that is obviously corrupted, trying
> to use it crashes QEMU since we end up with a null s->refcount_table
> after qcow2_refcount_init().
>
> These images can however be repaired, so allow opening them if the
> BDRV_O_CHECK flag is set.
>
> Signed-off-by: Alberto Garcia <address@hidden>
> ---
> block/qcow2.c | 6 ++++++
> tests/qemu-iotests/060 | 7 +++++++
> tests/qemu-iotests/060.out | 5 +++++
> 3 files changed, 18 insertions(+)
Reviewed-by: Max Reitz <address@hidden>
signature.asc
Description: OpenPGP digital signature
- [Qemu-devel] [PATCH 0/4] Misc qcow2 corruption checks, Alberto Garcia, 2017/11/01
- [Qemu-devel] [PATCH 4/4] qcow2: Add iotest for an empty refcount table, Alberto Garcia, 2017/11/01
- [Qemu-devel] [PATCH 2/4] qcow2: Prevent allocating L2 tables at offset 0, Alberto Garcia, 2017/11/01
- [Qemu-devel] [PATCH 3/4] qcow2: Don't open images with header.refcount_table_clusters == 0, Alberto Garcia, 2017/11/01
- Re: [Qemu-devel] [PATCH 3/4] qcow2: Don't open images with header.refcount_table_clusters == 0,
Max Reitz <=
- [Qemu-devel] [PATCH 1/4] qcow2: Prevent allocating refcount blocks at offset 0, Alberto Garcia, 2017/11/01
- Re: [Qemu-devel] [PATCH 0/4] Misc qcow2 corruption checks, Max Reitz, 2017/11/02