From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37087) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WTfRI-00052W-4a for qemu-devel@nongnu.org; Fri, 28 Mar 2014 18:39:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WTfRB-00084G-VG for qemu-devel@nongnu.org; Fri, 28 Mar 2014 18:39:52 -0400 Message-ID: <5335FA2D.3060205@redhat.com> Date: Fri, 28 Mar 2014 23:39:41 +0100 From: Max Reitz MIME-Version: 1.0 References: <1395835569-21193-1-git-send-email-stefanha@redhat.com> <1395835569-21193-26-git-send-email-stefanha@redhat.com> In-Reply-To: <1395835569-21193-26-git-send-email-stefanha@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH for-2.0 25/47] qcow2: Fix backing file name length check List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Stefan Hajnoczi , qemu-devel@nongnu.org Cc: Kevin Wolf , pmatouse@redhat.com, qemu-stable@nongnu.org On 26.03.2014 13:05, Stefan Hajnoczi wrote: > From: Kevin Wolf > > len could become negative and would pass the check then. Nothing bad > happened because bdrv_pread() happens to return an error for negative > length values, but make variables for sizes unsigned anyway. > > This patch also changes the behaviour to error out on invalid lengths > instead of silently truncating it to 1023. > > Signed-off-by: Kevin Wolf > --- > block/qcow2.c | 9 ++++++--- > tests/qemu-iotests/080 | 8 ++++++++ > tests/qemu-iotests/080.out | 5 +++++ > 3 files changed, 19 insertions(+), 3 deletions(-) Reviewed-by: Max Reitz