From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33178) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WUeKm-0005rK-8Y for qemu-devel@nongnu.org; Mon, 31 Mar 2014 11:41:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WUeKd-0005bs-0x for qemu-devel@nongnu.org; Mon, 31 Mar 2014 11:41:12 -0400 Received: from mail-lb0-f170.google.com ([209.85.217.170]:50995) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WUeKc-0005bg-RE for qemu-devel@nongnu.org; Mon, 31 Mar 2014 11:41:02 -0400 Received: by mail-lb0-f170.google.com with SMTP id s7so5931733lbd.15 for ; Mon, 31 Mar 2014 08:41:01 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <1396275242-10810-13-git-send-email-mst@redhat.com> References: <1396275242-10810-1-git-send-email-mst@redhat.com> <1396275242-10810-13-git-send-email-mst@redhat.com> From: Peter Maydell Date: Mon, 31 Mar 2014 16:40:41 +0100 Message-ID: Content-Type: text/plain; charset=UTF-8 Subject: Re: [Qemu-devel] [PATCH v4 12/30] vmstate: fix buffer overflow in target-arm/machine.c List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Michael S. Tsirkin" Cc: Michael Roth , Juan Quintela , Alexey Kardashevskiy , qemu-stable , QEMU Developers , Anthony Liguori , =?UTF-8?Q?Andreas_F=C3=A4rber?= , Dave Gilbert On 31 March 2014 15:16, Michael S. Tsirkin wrote: > CVE-2013-4531 > > cpreg_vmstate_indexes is a VARRAY_INT32. A negative value for > cpreg_vmstate_array_len will cause a buffer overflow. > > VMSTATE_INT32_LE was supposed to protect against this > but doesn't because it doesn't validate that input is > non-negative. > > Fix this macro to valide the value appropriately. > > The only other user of VMSTATE_INT32_LE doesn't > ever use negative numbers so it doesn't care. This fixes the bug, but it's rather unintuitive semantics for an INT32_LE not to simply do a signed comparison... Maybe rename the macro? thanks -- PMM