From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53962) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XF7Ik-0003PJ-JI for qemu-devel@nongnu.org; Wed, 06 Aug 2014 15:55:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XF7Ie-0005d3-Fr for qemu-devel@nongnu.org; Wed, 06 Aug 2014 15:55:10 -0400 Received: from mx1.redhat.com ([209.132.183.28]:27093) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XF7Ie-0005cD-9T for qemu-devel@nongnu.org; Wed, 06 Aug 2014 15:55:04 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s76Jt2r2006618 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Wed, 6 Aug 2014 15:55:03 -0400 From: Jeff Cody Date: Wed, 6 Aug 2014 15:54:57 -0400 Message-Id: <9c38d02efb0c96e01e1edc6b80ba99f014d5e908.1407353952.git.jcody@redhat.com> In-Reply-To: References: In-Reply-To: References: Subject: [Qemu-devel] [PATCH 1/2] block: vhdx - add error check List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, pbonzini@redhat.com, armbru@redhat.com, stefanha@redhat.com This add an error check for an invalid descriptor entry signature, when flushing the log descriptor entries. Signed-off-by: Jeff Cody --- block/vhdx-log.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/block/vhdx-log.c b/block/vhdx-log.c index a77c040..7c2630d 100644 --- a/block/vhdx-log.c +++ b/block/vhdx-log.c @@ -435,6 +435,11 @@ static int vhdx_log_flush_desc(BlockDriverState *bs, VHDXLogDescriptor *desc, /* write 'count' sectors of sector */ memset(buffer, 0, VHDX_LOG_SECTOR_SIZE); count = desc->zero_length / VHDX_LOG_SECTOR_SIZE; + } else { + error_report("Invalid VHDX log descriptor entry signature 0x%" PRIx32, + desc->signature); + ret = -EINVAL; + goto exit; } file_offset = desc->file_offset; -- 1.9.3