From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53389) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UlUgG-0002Au-RO for qemu-devel@nongnu.org; Sat, 08 Jun 2013 21:44:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UlUgE-0002Gg-IQ for qemu-devel@nongnu.org; Sat, 08 Jun 2013 21:44:28 -0400 Received: from mx1.redhat.com ([209.132.183.28]:21364) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UlUgE-0002Ga-Au for qemu-devel@nongnu.org; Sat, 08 Jun 2013 21:44:26 -0400 Received: from int-mx12.intmail.prod.int.phx2.redhat.com (int-mx12.intmail.prod.int.phx2.redhat.com [10.5.11.25]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r591iP9T013284 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Sat, 8 Jun 2013 21:44:25 -0400 From: Fam Zheng Date: Sun, 9 Jun 2013 09:44:15 +0800 Message-Id: <1370742255-16400-1-git-send-email-famz@redhat.com> Subject: [Qemu-devel] [PATCH] vmdk: refuse to open higher version than supported List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: kwolf@redhat.com, jcody@redhat.com, Fam Zheng , stefanha@redhat.com Refuse to open higher version for safety. Although we try to be compatible with published VMDK spec, VMware has newer version from ESXi 5.1 exported OVF/OVA, which we have no knowledge what's changed in it. And it is very likely to have more new versions in the future, so it's not safe to open them blindly. Signed-off-by: Fam Zheng --- block/vmdk.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/block/vmdk.c b/block/vmdk.c index 608daaf..d9c2368 100644 --- a/block/vmdk.c +++ b/block/vmdk.c @@ -558,6 +558,10 @@ static int vmdk_open_vmdk4(BlockDriverState *bs, header = footer.header; } + if (le32_to_cpu(header.version) >= 3) { + return -EINVAL; + } + l1_entry_sectors = le32_to_cpu(header.num_gtes_per_gte) * le64_to_cpu(header.granularity); if (l1_entry_sectors == 0) { -- 1.8.3