[Qemu-devel] [PATCH 0/7] qcow2 check improvements

Vladimir Sementsov-Ogievskiy posted 7 patches 7 years, 2 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20180817122219.16206-1-vsementsov@virtuozzo.com
Test docker-clang@ubuntu failed
Test checkpatch passed
There is a newer version of this series
block/qcow2-refcount.c | 270 +++++++++++++++++++++++++++++++++++++++----------
1 file changed, 219 insertions(+), 51 deletions(-)
[Qemu-devel] [PATCH 0/7] qcow2 check improvements
Posted by Vladimir Sementsov-Ogievskiy 7 years, 2 months ago
Hi all!

v2:
02, 06: check bdrv_getlength error return code

v1:

We've faced the following problem: after host fs corruption, vm images
becomes invalid. And which is interesting, starting qemu-img check on
them led to allocating of the whole RAM and then killing qemu-img by
OOM Killer.

This was due to corrupted l2 entries, which referenced clusters far-far
beyond the end of the qcow2 file.
02 is a generic fix for the bug, 01 is unrelated improvement, 03-07 are
additional info and fixing for such corrupted table entries.

Questions on 02, 06 and 07:
1. Should restrictions be more or less strict?
2. Are there valid cases, when such entries should not be considered as
   corrupted?

Vladimir Sementsov-Ogievskiy (7):
  block/qcow2-refcount: fix check_oflag_copied
  block/qcow2-refcount: avoid eating RAM
  block/qcow2-refcount: check_refcounts_l2: refactor compressed case
  block/qcow2-refcount: check_refcounts_l2: reduce ignored overlaps
  block/qcow2-refcount: check_refcounts_l2: split fix_l2_entry_to_zero
  block/qcow2-refcount: fix out-of-file L1 entries to be zero
  block/qcow2-refcount: fix out-of-file L2 entries to be read-as-zero

 block/qcow2-refcount.c | 270 +++++++++++++++++++++++++++++++++++++++----------
 1 file changed, 219 insertions(+), 51 deletions(-)

-- 
2.11.1


Re: [Qemu-devel] [PATCH 0/7] qcow2 check improvements
Posted by Vladimir Sementsov-Ogievskiy 7 years ago
ping

Hi, what about this?

17.08.2018 15:22, Vladimir Sementsov-Ogievskiy wrote:
> Hi all!
>
> v2:
> 02, 06: check bdrv_getlength error return code
>
> v1:
>
> We've faced the following problem: after host fs corruption, vm images
> becomes invalid. And which is interesting, starting qemu-img check on
> them led to allocating of the whole RAM and then killing qemu-img by
> OOM Killer.
>
> This was due to corrupted l2 entries, which referenced clusters far-far
> beyond the end of the qcow2 file.
> 02 is a generic fix for the bug, 01 is unrelated improvement, 03-07 are
> additional info and fixing for such corrupted table entries.
>
> Questions on 02, 06 and 07:
> 1. Should restrictions be more or less strict?
> 2. Are there valid cases, when such entries should not be considered as
>     corrupted?
>
> Vladimir Sementsov-Ogievskiy (7):
>    block/qcow2-refcount: fix check_oflag_copied
>    block/qcow2-refcount: avoid eating RAM
>    block/qcow2-refcount: check_refcounts_l2: refactor compressed case
>    block/qcow2-refcount: check_refcounts_l2: reduce ignored overlaps
>    block/qcow2-refcount: check_refcounts_l2: split fix_l2_entry_to_zero
>    block/qcow2-refcount: fix out-of-file L1 entries to be zero
>    block/qcow2-refcount: fix out-of-file L2 entries to be read-as-zero
>
>   block/qcow2-refcount.c | 270 +++++++++++++++++++++++++++++++++++++++----------
>   1 file changed, 219 insertions(+), 51 deletions(-)
>


-- 
Best regards,
Vladimir