From 0f40d03e693cb123d0daef234ffef87d39e2fca4 Mon Sep 17 00:00:00 2001 From: Michael Young Date: Feb 02 2012 23:57:01 +0000 Subject: Fix buffer overflow in e1000 emulation for HVM guests [CVE-2012-0029] --- diff --git a/qemu-xen-4.1-testing.git-3cf61880403b4e484539596a95937cc066243388.patch b/qemu-xen-4.1-testing.git-3cf61880403b4e484539596a95937cc066243388.patch new file mode 100644 index 0000000..3b9933a --- /dev/null +++ b/qemu-xen-4.1-testing.git-3cf61880403b4e484539596a95937cc066243388.patch @@ -0,0 +1,43 @@ +From 3cf61880403b4e484539596a95937cc066243388 Mon Sep 17 00:00:00 2001 +From: Ian Campbell +Date: Thu, 2 Feb 2012 13:47:06 +0000 +Subject: [PATCH] e1000: bounds packet size against buffer size + +Otherwise we can write beyond the buffer and corrupt memory. This is tracked +as CVE-2012-0029. + +Signed-off-by: Anthony Liguori + +(Backported from qemu upstream 65f82df0d7a71ce1b10cd4c5ab08888d176ac840 + by Ian Campbell.) + +Signed-off-by: Ian Campbell +(cherry picked from commit ebe37b2a3f844bad02dcc30d081f39eda06118f8) +--- + hw/e1000.c | 3 +++ + 1 files changed, 3 insertions(+), 0 deletions(-) + +diff --git a/tools/ioemu-qemu-xen/hw/e1000.c b/tools/ioemu-qemu-xen/hw/e1000.c +index bb3689e..97104ed 100644 +--- a/tools/ioemu-qemu-xen/hw/e1000.c ++++ b/tools/ioemu-qemu-xen/hw/e1000.c +@@ -444,6 +444,8 @@ process_tx_desc(E1000State *s, struct e1000_tx_desc *dp) + bytes = split_size; + if (tp->size + bytes > msh) + bytes = msh - tp->size; ++ ++ bytes = MIN(sizeof(tp->data) - tp->size, bytes); + cpu_physical_memory_read(addr, tp->data + tp->size, bytes); + if ((sz = tp->size + bytes) >= hdr && tp->size < hdr) + memmove(tp->header, tp->data, hdr); +@@ -459,6 +461,7 @@ process_tx_desc(E1000State *s, struct e1000_tx_desc *dp) + // context descriptor TSE is not set, while data descriptor TSE is set + DBGOUT(TXERR, "TCP segmentaion Error\n"); + } else { ++ split_size = MIN(sizeof(tp->data) - tp->size, split_size); + cpu_physical_memory_read(addr, tp->data + tp->size, split_size); + tp->size += split_size; + } +-- +1.7.2.5 + diff --git a/xen.spec b/xen.spec index a298bf4..6cfaa5c 100644 --- a/xen.spec +++ b/xen.spec @@ -10,7 +10,7 @@ Summary: Xen is a virtual machine monitor Name: xen Version: 4.1.2 -Release: 5%{?dist} +Release: 6%{?dist} Group: Development/Libraries License: GPLv2+ and LGPLv2+ and BSD URL: http://xen.org/ @@ -56,6 +56,7 @@ Patch33: xend.empty.xml.patch Patch34: xend.catchbt.patch Patch35: xend-pci-loop.patch Patch36: localgcc47fix.patch +Patch37: qemu-xen-4.1-testing.git-3cf61880403b4e484539596a95937cc066243388.patch Patch50: upstream-23936:cdb34816a40a-rework Patch51: upstream-23937:5173834e8476 @@ -218,6 +219,7 @@ manage Xen virtual machines. %patch34 -p1 %patch35 -p1 %patch36 -p1 +%patch37 -p1 %patch50 -p1 %patch51 -p1 @@ -630,6 +632,9 @@ rm -rf %{buildroot} %endif %changelog +* Thu Feb 02 2012 Michael Young - 4.1.2-6 +- Fix buffer overflow in e1000 emulation for HVM guests [CVE-2012-0029] + * Sat Jan 28 2012 Michael Young - 4.1.2-5 - Start building xen's ocaml libraries if appropriate unless --without ocaml was specified