From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45750) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X3Vlz-00015F-Hs for qemu-devel@nongnu.org; Sat, 05 Jul 2014 15:37:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1X3Vls-0002nc-Q9 for qemu-devel@nongnu.org; Sat, 05 Jul 2014 15:37:23 -0400 Received: from mx1.redhat.com ([209.132.183.28]:27512) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1X3Vls-0002nY-Hn for qemu-devel@nongnu.org; Sat, 05 Jul 2014 15:37:16 -0400 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s65JbFtv003148 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Sat, 5 Jul 2014 15:37:15 -0400 Message-ID: <53B853EA.5000306@redhat.com> Date: Sat, 05 Jul 2014 21:37:14 +0200 From: Max Reitz MIME-Version: 1.0 References: <1404489305-8750-1-git-send-email-kwolf@redhat.com> <1404489305-8750-3-git-send-email-kwolf@redhat.com> In-Reply-To: <1404489305-8750-3-git-send-email-kwolf@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 2/4] qcow2: Make qiov match request size until backing file EOF List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin Wolf , qemu-devel@nongnu.org Cc: stefanha@redhat.com On 04.07.2014 17:55, Kevin Wolf wrote: > If a qcow2 image has a shorter backing file and a read request to > unallocated clusters goes across EOF of the backing file, the backing > file sees a shortened request and the rest is filled with zeros. > However, the original too long qiov was used with the shortened request. > > This patch makes the qiov size match the request size, avoiding a > potential buffer overflow in raw-posix. > > Signed-off-by: Kevin Wolf > --- > block/qcow2.c | 11 ++++++++++- > 1 file changed, 10 insertions(+), 1 deletion(-) Reviewed-by: Max Reitz