Skip to content

Add section footers to detect corrupted migration streams

Dr. David Alan Gilbert (git) qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 12 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4Merge section header writingsavevm.c+28 -451 reply
2/4Disable section footers on older machine typeshw/i386/pc_piix.c hw/i386/pc_q35.c include/migration/migration.h +1 more+12 -02 replies
3/4Add a protective section footerinclude/migration/migration.h savevm.c+62 -01 reply
4/4Teach analyze-migration.py about section footersscripts/analyze-migration.py+5 -00 replies

Reviews trailers per patch

3 of 4 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchAmit ShahJuan Quintela
SeriesR-b
1/4R-b
2/4R-b
3/4R-b
4/4

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

Read the v1 thread

Cover letter [Qemu-devel] [PATCH 0/4] Add section footers to detect corrupted migration streams

From: "Dr. David Alan Gilbert" <[email protected]>

Badly formatted migration streams can go undetected or produce misleading errors due to a lock of checking at the end of sections. In particular a section that adds an extra 0x00 at the end causes what looks like a normal end of stream and thus doesn't produce any errors, and something that ends in a 0x01..0x04 kind of look like real section headers and then fail when the section parser tries to figure out which section they are. This is made worse by the choice of 0x00..0x04 being small numbers that are particularly common in normal section data.

This patch series adds a section footer consisting of a marker (0x7e - ~) followed by the section-id that was also sent in the header. If they mismatch then it throws an error explaining which section was being loaded.

The footers are tied to new machine types (on both pc types).

Dr. David Alan Gilbert (4):
Merge section header writing
Disable section footers on older machine types Add a protective section footer
Teach analyze-migration.py about section footers

 hw/i386/pc_piix.c             |   2 +
 hw/i386/pc_q35.c              |   2 +
 include/migration/migration.h |   2 +
 savevm.c                      | 141 ++++++++++++++++++++++++++++--------------
 scripts/analyze-migration.py  |   5 ++
 5 files changed, 107 insertions(+), 45 deletions(-)
Signature · 1 line
2.4.1