Git-Url: 
http://git.frugalware.org/gitweb/gitweb.cgi?p=frugalware-current.git;a=commitdiff;h=8b89aeab4f02529784fab90bb7826c63d0189e1b

commit 8b89aeab4f02529784fab90bb7826c63d0189e1b
Author: kikadf <[email protected]>
Date:   Sun Apr 20 17:38:29 2014 +0200

qemu-1.6.1-3-x86_64

* Fix CVE-2014-0150

diff --git a/source/xapps-extra/qemu/CVE-2014-0150.patch 
b/source/xapps-extra/qemu/CVE-2014-0150.patch
new file mode 100644
index 0000000..6d1d101
--- /dev/null
+++ b/source/xapps-extra/qemu/CVE-2014-0150.patch
@@ -0,0 +1,12 @@
+diff -Naur qemu-1.6.1/hw/net/virtio-net.c qemu-1.6.1.new/hw/net/virtio-net.c
+--- qemu-1.6.1/hw/net/virtio-net.c     2013-10-09 21:20:32.000000000 +0200
++++ qemu-1.6.1.new/hw/net/virtio-net.c 2014-04-20 16:50:58.355124813 +0200
+@@ -655,7 +655,7 @@
+         goto error;
+     }
+
+-    if (n->mac_table.in_use + mac_data.entries <= MAC_TABLE_ENTRIES) {
++    if (mac_data.entries <= MAC_TABLE_ENTRIES - n->mac_table.in_use) {
+         s = iov_to_buf(iov, iov_cnt, 0, n->mac_table.macs,
+                        mac_data.entries * ETH_ALEN);
+         if (s != mac_data.entries * ETH_ALEN) {
diff --git a/source/xapps-extra/qemu/FrugalBuild 
b/source/xapps-extra/qemu/FrugalBuild
index 72daabe..f5987ec 100644
--- a/source/xapps-extra/qemu/FrugalBuild
+++ b/source/xapps-extra/qemu/FrugalBuild
@@ -9,7 +9,7 @@ USE_DEVEL=${USE_DEVEL:-"n"}
pkgname=qemu
pkgver=1.6.1
Fuse $USE_DEVEL && pkgver=svn6369
-pkgrel=2
+pkgrel=3
Fuse $USE_DEVEL && pkgrel=1
pkgdesc="QEMU is a FAST! processor emulator"
url="http://www.nongnu.org/qemu/";
@@ -48,8 +48,10 @@ subdepends=('glib2' 'glib2 nss')
TARGETS="i386-softmmu x86_64-softmmu arm-softmmu"

# FSA fix ***
-source=(${source[@]} CVE-2013-4375.patch)
-sha1sums=(${sha1sums[@]} '761b353dbbd110fd8e75e0e5f471effdc8e37beb')
+# FIXME: qemu-2.0 is vulnerable by CVE-2014-0150
+source=(${source[@]} CVE-2013-4375.patch CVE-2014-0150.patch)
+sha1sums=(${sha1sums[@]} '761b353dbbd110fd8e75e0e5f471effdc8e37beb' \
+                         '21f8788763786778efff306e07d0f0dc64aabb36')
# ***********

build()
diff --git a/source/xapps-extra/qemu/qemu-2.0-CVE-2014-0150.patch 
b/source/xapps-extra/qemu/qemu-2.0-CVE-2014-0150.patch
new file mode 100644
index 0000000..c280a3f
--- /dev/null
+++ b/source/xapps-extra/qemu/qemu-2.0-CVE-2014-0150.patch
@@ -0,0 +1,47 @@
+From edc243851279e3393000b28b6b69454cae1190ef Mon Sep 17 00:00:00 2001
+From: "Michael S. Tsirkin" <[email protected]>
+Date: Fri, 11 Apr 2014 15:18:08 +0300
+Subject: [PATCH] virtio-net: fix guest-triggerable buffer overrun
+Bug-Debian: http://bugs.debian.org/744221
+
+When VM guest programs multicast addresses for
+a virtio net card, it supplies a 32 bit
+entries counter for the number of addresses.
+These addresses are read into tail portion of
+a fixed macs array which has size MAC_TABLE_ENTRIES,
+at offset equal to in_use.
+
+To avoid overflow of this array by guest, qemu attempts
+to test the size as follows:
+-    if (in_use + mac_data.entries <= MAC_TABLE_ENTRIES) {
+
+however, as mac_data.entries is uint32_t, this sum
+can overflow, e.g. if in_use is 1 and mac_data.entries
+is 0xffffffff then in_use + mac_data.entries will be 0.
+
+Qemu will then read guest supplied buffer into this
+memory, overflowing buffer on heap.
+
+CVE-2014-0150
+
+Cc: [email protected]
+Signed-off-by: Michael S. Tsirkin <[email protected]>
+Message-id: [email protected]
+Reviewed-by: Michael Tokarev <[email protected]>
+Signed-off-by: Peter Maydell <[email protected]>
+Backported-to-1.7: Michael Tokarev <[email protected]>
+---
+ hw/net/virtio-net.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/hw/net/virtio-net.c
++++ b/hw/net/virtio-net.c
+@@ -656,7 +656,7 @@ static int virtio_net_handle_mac(VirtION
+         goto error;
+     }
+
+-    if (n->mac_table.in_use + mac_data.entries <= MAC_TABLE_ENTRIES) {
++    if (mac_data.entries <= MAC_TABLE_ENTRIES - n->mac_table.in_use) {
+         s = iov_to_buf(iov, iov_cnt, 0,
+                        &n->mac_table.macs[n->mac_table.in_use * ETH_ALEN],
+                        mac_data.entries * ETH_ALEN);
_______________________________________________
Frugalware-git mailing list
[email protected]
http://frugalware.org/mailman/listinfo/frugalware-git

Reply via email to