From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59073) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yufih-0006Zw-Ee for qemu-devel@nongnu.org; Tue, 19 May 2015 07:30:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Yufie-0003QE-9R for qemu-devel@nongnu.org; Tue, 19 May 2015 07:29:59 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38251) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Yufie-0003Q5-1m for qemu-devel@nongnu.org; Tue, 19 May 2015 07:29:56 -0400 From: "Dr. David Alan Gilbert (git)" Date: Tue, 19 May 2015 12:29:49 +0100 Message-Id: <1432034993-24431-1-git-send-email-dgilbert@redhat.com> Subject: [Qemu-devel] [PATCH 0/4] Add section footers to detect corrupted migration streams List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: amit.shah@redhat.com, agraf@suse.de, quintela@redhat.com From: "Dr. David Alan Gilbert" 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(-) -- 2.4.1