Received: from eggs.gnu.org ([2001:4830:134:3::10]:48231) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YuzlD-0003Re-TG for qemu-devel@nongnu.org; Wed, 20 May 2015 04:53:56 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YuzlA-0005sS-8s for qemu-devel@nongnu.org; Wed, 20 May 2015 04:53:55 -0400 Received: from mx1.redhat.com ([209.132.183.28]:43046) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YuzlA-0005sI-1z for qemu-devel@nongnu.org; Wed, 20 May 2015 04:53:52 -0400 From: Juan Quintela In-Reply-To: <1432034993-24431-4-git-send-email-dgilbert@redhat.com> (David Alan Gilbert's message of "Tue, 19 May 2015 12:29:52 +0100") References: <1432034993-24431-1-git-send-email-dgilbert@redhat.com> <1432034993-24431-4-git-send-email-dgilbert@redhat.com> Date: Wed, 20 May 2015 10:53:49 +0200 Message-ID: <87617nociq.fsf@neno.neno> MIME-Version: 1.0 Content-Type: text/plain Subject: Re: [Qemu-devel] [PATCH 3/4] Add a protective section footer Reply-To: quintela@redhat.com List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Dr. David Alan Gilbert (git)" Cc: amit.shah@redhat.com, qemu-devel@nongnu.org, agraf@suse.de "Dr. David Alan Gilbert (git)" wrote: > 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 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. > > Signed-off-by: Dr. David Alan Gilbert Reviewed-by: Juan Quintela