aboutsummaryrefslogtreecommitdiffstats
path: root/main/xen/xsa209-qemut.patch
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2017-02-27 19:19:21 +0100
committerNatanael Copa <ncopa@alpinelinux.org>2017-02-27 19:25:18 +0100
commitda8fdc46be4a3e48a559102b6ff9f2cc78d4a37c (patch)
tree78fa7dfeceddb2942aa543da0a3390bc3a63224a /main/xen/xsa209-qemut.patch
parenta833ffd23fed18614233166946b4f8341c5a26ef (diff)
downloadaports-da8fdc46be4a3e48a559102b6ff9f2cc78d4a37c.tar.bz2
aports-da8fdc46be4a3e48a559102b6ff9f2cc78d4a37c.tar.xz
main/xen: sec fixes fro xsa-207 - xsa-209
added perl-dev as makedepends due to man2pod moved to there. - XSA-207 - CVE-2017-2615 XSA-208 - CVE-2017-2620 XSA-209 - XSA-210 fixes #6915
Diffstat (limited to 'main/xen/xsa209-qemut.patch')
-rw-r--r--main/xen/xsa209-qemut.patch54
1 files changed, 54 insertions, 0 deletions
diff --git a/main/xen/xsa209-qemut.patch b/main/xen/xsa209-qemut.patch
new file mode 100644
index 0000000000..ffc574ba86
--- /dev/null
+++ b/main/xen/xsa209-qemut.patch
@@ -0,0 +1,54 @@
+From: Gerd Hoffmann <kraxel@redhat.com>
+Subject: [PATCH 3/3] cirrus: add blit_is_unsafe call to cirrus_bitblt_cputovideo
+
+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.
+
+The missing blit width check allows to overflow cirrus_bltbuf,
+with the attractive target cirrus_srcptr (current cirrus_bltbuf write
+position) being located right after cirrus_bltbuf in CirrusVGAState.
+
+Due to cirrus emulation writing cirrus_bltbuf bytewise the attacker
+hasn't full control over cirrus_srcptr though, only one byte can be
+changed. Once the first byte has been modified further writes land
+elsewhere.
+
+[ This is CVE-2017-2620 / XSA-209 - Ian Jackson ]
+
+Fixed compilation by removing extra parameter to blit_is_unsafe. -iwj
+
+Reported-by: Gerd Hoffmann <ghoffman@redhat.com>
+Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
+Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
+---
+diff --git a/hw/cirrus_vga.c b/hw/cirrus_vga.c
+index e6c3893..45facb6 100644
+--- a/hw/cirrus_vga.c
++++ b/tools/qemu-xen-traditional/hw/cirrus_vga.c
+@@ -900,6 +900,10 @@ static int cirrus_bitblt_cputovideo(CirrusVGAState * s)
+ {
+ int w;
+
++ if (blit_is_unsafe(s)) {
++ 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);