From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37684) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b8jd8-0007VN-F4 for qemu-devel@nongnu.org; Fri, 03 Jun 2016 03:34:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1b8jd2-0008W5-Qj for qemu-devel@nongnu.org; Fri, 03 Jun 2016 03:34:53 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38486) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1b8jd2-0008Vx-L4 for qemu-devel@nongnu.org; Fri, 03 Jun 2016 03:34:48 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 367A08F01F for ; Fri, 3 Jun 2016 07:34:48 +0000 (UTC) From: Gerd Hoffmann Date: Fri, 3 Jun 2016 09:34:40 +0200 Message-Id: <1464939283-32184-4-git-send-email-kraxel@redhat.com> In-Reply-To: <1464939283-32184-1-git-send-email-kraxel@redhat.com> References: <1464939283-32184-1-git-send-email-kraxel@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PULL 3/6] vmsvga: add more fifo checks List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Gerd Hoffmann , P J P Make sure all fifo ptrs are within range. Fixes: CVE-2016-4454 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 --- 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.8.3.1