From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41798) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bWrk7-0003xy-Om for qemu-devel@nongnu.org; Mon, 08 Aug 2016 17:05:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bWrk4-0005vh-JT for qemu-devel@nongnu.org; Mon, 08 Aug 2016 17:05:51 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:30973 helo=mx0a-001b2d01.pphosted.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bWrk4-0005vM-CB for qemu-devel@nongnu.org; Mon, 08 Aug 2016 17:05:48 -0400 Received: from pps.filterd (m0098416.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.11/8.16.0.11) with SMTP id u78KxksY024540 for ; Mon, 8 Aug 2016 17:05:48 -0400 Received: from e34.co.us.ibm.com (e34.co.us.ibm.com [32.97.110.152]) by mx0b-001b2d01.pphosted.com with ESMTP id 24n9h0bw3x-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Mon, 08 Aug 2016 17:05:48 -0400 Received: from localhost by e34.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 8 Aug 2016 15:05:47 -0600 From: Michael Roth Date: Mon, 8 Aug 2016 16:03:58 -0500 In-Reply-To: <1470690267-31454-1-git-send-email-mdroth@linux.vnet.ibm.com> References: <1470690267-31454-1-git-send-email-mdroth@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Message-Id: <1470690267-31454-28-git-send-email-mdroth@linux.vnet.ibm.com> Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH 27/56] vmsvga: add more fifo checks List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: qemu-stable@nongnu.org, Gerd Hoffmann , P J P From: Gerd Hoffmann Make sure all fifo ptrs are within range. Fixes: CVE-2016-4454 Cc: qemu-stable@nongnu.org Cc: P J P Reported-by: =E6=9D=8E=E5=BC=BA Signed-off-by: Gerd Hoffmann Message-id: 1464592161-18348-3-git-send-email-kraxel@redhat.com (cherry picked from commit c2e3c54d3960bc53bfa3a5ce7ea7a050b9be267e) Signed-off-by: Michael Roth --- hw/display/vmware_vga.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hw/display/vmware_vga.c b/hw/display/vmware_vga.c index 63a7c05..a26e62e 100644 --- a/hw/display/vmware_vga.c +++ b/hw/display/vmware_vga.c @@ -563,7 +563,10 @@ static inline int vmsvga_fifo_length(struct vmsvga_s= tate_s *s) if (CMD(min) < (uint8_t *) s->cmd->fifo - (uint8_t *) s->fifo) { return 0; } - if (CMD(max) > SVGA_FIFO_SIZE) { + if (CMD(max) > SVGA_FIFO_SIZE || + CMD(min) >=3D SVGA_FIFO_SIZE || + CMD(stop) >=3D SVGA_FIFO_SIZE || + CMD(next_cmd) >=3D SVGA_FIFO_SIZE) { return 0; } if (CMD(max) < CMD(min) + 10 * 1024) { --=20 1.9.1