Skip to content

Add checks for corruption in the snapshot table

Alberto Garcia qemu-devel 2 versions – Applied

Status from this message: Thanks, applied to the block branch.

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest7 patches 3 repliesApplied
  2. v17 patches 13 repliesSuperseded

Changes in v2 from the cover letter

- Patch 3: Don't leak l1_table and report the error returned by qcow2_validate_table()
- Patch 5: Report the error returned by qcow2_validate_table().

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/7qcow2: Generalize validate_table_offset() into qcow2_validate_table()block/qcow2.c block/qcow2.h tests/qemu-iotests/080.out+43 -600 replies
2/7qcow2: Check L1 table offset in qcow2_snapshot_load_tmp()block/qcow2-snapshot.c tests/qemu-iotests/080 tests/qemu-iotests/080.out+21 -50 replies
3/7qcow2: Check L1 table parameters in qcow2_expand_zero_clusters()block/qcow2-cluster.c tests/qemu-iotests/080 tests/qemu-iotests/080.out+23 -71 reply
4/7qcow2: Check snapshot L1 tables in qcow2_check_metadata_overlap()block/qcow2-refcount.c tests/qemu-iotests/080 tests/qemu-iotests/080.out+17 -10 replies
5/7qcow2: Check snapshot L1 table in qcow2_snapshot_goto()block/qcow2-snapshot.c tests/qemu-iotests/080 tests/qemu-iotests/080.out+15 -01 reply
6/7qcow2: Check snapshot L1 table in qcow2_snapshot_delete()block/qcow2-snapshot.c tests/qemu-iotests/080 tests/qemu-iotests/080.out+11 -00 replies
7/7qcow2: Make qemu-img check detect corrupted L1 tables in snapshotsblock/qcow2-refcount.c tests/qemu-iotests/080 tests/qemu-iotests/080.out+36 -00 replies

Reviews trailers per patch

All 7 patches have a Reviewed-by or Acked-by.

PatchEric Blake
1/7R-b
2/7R-b
3/7R-b
4/7R-b
5/7R-b
6/7R-b
7/7R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [Qemu-devel] [PATCH v2 0/7] Add checks for corruption in the snapshot table

Hey,

here's the new version of this series. It fixes a leak reported by Kevin and adds a couple of error_report_err() to make use of the message returned by qcow2_validate_table().

Regards,

Berto

Changes:

v2:
- Patch 3: Don't leak l1_table and report the error returned by qcow2_validate_table()
- Patch 5: Report the error returned by qcow2_validate_table().

v1: https://lists.gnu.org/archive/html/qemu-block/2018-03/msg00030.html
- Initial version

Output of backport-diff against v1:

Key:
[----] : patches are identical
[####] : number of functional differences between upstream/downstream patch [down] : patch is downstream-only
The flags [FC] indicate (F)unctional and (C)ontextual differences, respectively

001/7:[----] [-C] 'qcow2: Generalize validate_table_offset() into qcow2_validate_table()' 002/7:[----] [--] 'qcow2: Check L1 table offset in qcow2_snapshot_load_tmp()' 003/7:[0010] [FC] 'qcow2: Check L1 table parameters in qcow2_expand_zero_clusters()' 004/7:[----] [-C] 'qcow2: Check snapshot L1 tables in qcow2_check_metadata_overlap()' 005/7:[0007] [FC] 'qcow2: Check snapshot L1 table in qcow2_snapshot_goto()' 006/7:[----] [-C] 'qcow2: Check snapshot L1 table in qcow2_snapshot_delete()' 007/7:[----] [-C] 'qcow2: Make qemu-img check detect corrupted L1 tables in snapshots'

Alberto Garcia (7):
qcow2: Generalize validate_table_offset() into qcow2_validate_table()
qcow2: Check L1 table offset in qcow2_snapshot_load_tmp()
qcow2: Check L1 table parameters in qcow2_expand_zero_clusters()
qcow2: Check snapshot L1 tables in qcow2_check_metadata_overlap()
qcow2: Check snapshot L1 table in qcow2_snapshot_goto()
qcow2: Check snapshot L1 table in qcow2_snapshot_delete()
qcow2: Make qemu-img check detect corrupted L1 tables in snapshots

 block/qcow2-cluster.c      | 24 ++++++++++-----
 block/qcow2-refcount.c     | 24 ++++++++++++++-
 block/qcow2-snapshot.c     | 24 +++++++++++++--
 block/qcow2.c              | 77 ++++++++++++++++++----------------------------
 block/qcow2.h              | 10 +++---
 tests/qemu-iotests/080     | 22 ++++++++++++-
 tests/qemu-iotests/080.out | 58 ++++++++++++++++++++++++++++------
 7 files changed, 166 insertions(+), 73 deletions(-)
Signature · 1 line
2.11.0