From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54874) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XtJpa-0000k4-R0 for qemu-devel@nongnu.org; Tue, 25 Nov 2014 12:23:19 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XtJpV-0007ad-PZ for qemu-devel@nongnu.org; Tue, 25 Nov 2014 12:23:14 -0500 Message-ID: <5474BAEC.3000309@redhat.com> Date: Tue, 25 Nov 2014 18:22:52 +0100 From: Max Reitz MIME-Version: 1.0 References: <1416935562-7760-1-git-send-email-kwolf@redhat.com> <1416935562-7760-2-git-send-email-kwolf@redhat.com> In-Reply-To: <1416935562-7760-2-git-send-email-kwolf@redhat.com> Content-Type: text/plain; charset=iso-8859-15; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2 1/3] qcow2: Fix header extension size check List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf , qemu-devel@nongnu.org Cc: armbru@redhat.com, stefanha@redhat.com, qemu-stable@nongnu.org On 2014-11-25 at 18:12, Kevin Wolf wrote: > After reading the extension header, offset is incremented, but not > checked against end_offset any more. This way an integer overflow could > happen when checking whether the extension end is within the allowed > range, effectively disabling the check. > > This patch adds the missing check and a test case for it. > > Cc: qemu-stable@nongnu.org > Reported-by: Max Reitz > Signed-off-by: Kevin Wolf > --- > block/qcow2.c | 2 +- > tests/qemu-iotests/080 | 2 ++ > tests/qemu-iotests/080.out | 2 ++ > 3 files changed, 5 insertions(+), 1 deletion(-) Reviewed-by: Max Reitz Using g_try_malloc0() might have been nice anyway, but it should work without, now (although it should have worked before as well...).