[pve-devel] applied: [PATCH kvm 1/2] fix CVE-2017-2620: display: cirrus: out-of-bounds access issue

Fabian Grünbichler f.gruenbichler at proxmox.com
Wed Feb 22 14:42:17 CET 2017


Signed-off-by: Fabian Grünbichler <f.gruenbichler at proxmox.com>
---
 ...s_unsafe_call_to_cirrus_bitblt_cputovideo.patch | 52 ++++++++++++++++++++++
 debian/patches/series                              |  1 +
 2 files changed, 53 insertions(+)
 create mode 100644 debian/patches/extra/CVE-2017-2620_cirrus_add_blit_is_unsafe_call_to_cirrus_bitblt_cputovideo.patch

diff --git a/debian/patches/extra/CVE-2017-2620_cirrus_add_blit_is_unsafe_call_to_cirrus_bitblt_cputovideo.patch b/debian/patches/extra/CVE-2017-2620_cirrus_add_blit_is_unsafe_call_to_cirrus_bitblt_cputovideo.patch
new file mode 100644
index 0000000..36f1158
--- /dev/null
+++ b/debian/patches/extra/CVE-2017-2620_cirrus_add_blit_is_unsafe_call_to_cirrus_bitblt_cputovideo.patch
@@ -0,0 +1,52 @@
+From d775c497a84a5c4be3f15cca85ca8440dd5880a0 Mon Sep 17 00:00:00 2001
+From: Gerd Hoffmann <kraxel at redhat.com>
+Date: Wed, 22 Feb 2017 13:42:31 +0100
+Subject: [PATCH qemu] cirrus: add blit_is_unsafe call to
+ cirrus_bitblt_cputovideo (CVE-2017-2620)
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+CIRRUS_BLTMODE_MEMSYSSRC blits do NOT check blit destination
+and blit width, at all.  Oops.  Fix it.
+
+Security impact: high.
+
+The missing blit destination check allows to write to host memory.
+Basically same as CVE-2014-8106 for the other blit variants.
+
+Signed-off-by: Gerd Hoffmann <kraxel at redhat.com>
+Message-id: 1487679663-3264-1-git-send-email-kraxel at redhat.com
+---
+ hw/display/cirrus_vga.c | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+diff --git a/hw/display/cirrus_vga.c b/hw/display/cirrus_vga.c
+index 1deb520..b9e7cb1 100644
+--- a/hw/display/cirrus_vga.c
++++ b/hw/display/cirrus_vga.c
+@@ -900,6 +900,10 @@ static int cirrus_bitblt_cputovideo(CirrusVGAState * s)
+ {
+     int w;
+ 
++    if (blit_is_unsafe(s, true)) {
++        return 0;
++    }
++
+     s->cirrus_blt_mode &= ~CIRRUS_BLTMODE_MEMSYSSRC;
+     s->cirrus_srcptr = &s->cirrus_bltbuf[0];
+     s->cirrus_srcptr_end = &s->cirrus_bltbuf[0];
+@@ -925,6 +929,10 @@ static int cirrus_bitblt_cputovideo(CirrusVGAState * s)
+ 	}
+         s->cirrus_srccounter = s->cirrus_blt_srcpitch * s->cirrus_blt_height;
+     }
++
++    /* the blit_is_unsafe call above should catch this */
++    assert(s->cirrus_blt_srcpitch <= CIRRUS_BLTBUFSIZE);
++
+     s->cirrus_srcptr = s->cirrus_bltbuf;
+     s->cirrus_srcptr_end = s->cirrus_bltbuf + s->cirrus_blt_srcpitch;
+     cirrus_update_memory_access(s);
+-- 
+2.1.4
+
diff --git a/debian/patches/series b/debian/patches/series
index eb57186..ff76828 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -94,3 +94,4 @@ extra/0003-sd-sdhci-check-transfer-mode-register-in-multi-block.patch
 extra/0004-sd-sdhci-block-count-enable-not-relevant-in-single-b.patch
 extra/0001-cirrus-fix-patterncopy-checks.patch
 extra/0002-Revert-cirrus-allow-zero-source-pitch-in-pattern-fil.patch
+extra/CVE-2017-2620_cirrus_add_blit_is_unsafe_call_to_cirrus_bitblt_cputovideo.patch
-- 
2.1.4





More information about the pve-devel mailing list