public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] gentoo-x86 commit in app-emulation/qemu/files: qemu-0.11.1-CVE-2012-0029-backport.patch
@ 2012-01-28 11:45 Sergei Trofimovich (slyfox)
  0 siblings, 0 replies; only message in thread
From: Sergei Trofimovich (slyfox) @ 2012-01-28 11:45 UTC (permalink / raw
  To: gentoo-commits

slyfox      12/01/28 11:45:00

  Added:                qemu-0.11.1-CVE-2012-0029-backport.patch
  Log:
  Backport fix for bug #400595 / CVE-2012-0029 (picked from qemu-kvm ebuild).
  
  (Portage version: 2.2.0_alpha84_p18/cvs/Linux x86_64)

Revision  Changes    Path
1.1                  app-emulation/qemu/files/qemu-0.11.1-CVE-2012-0029-backport.patch

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-emulation/qemu/files/qemu-0.11.1-CVE-2012-0029-backport.patch?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-emulation/qemu/files/qemu-0.11.1-CVE-2012-0029-backport.patch?rev=1.1&content-type=text/plain

Index: qemu-0.11.1-CVE-2012-0029-backport.patch
===================================================================
Backported upstream patch:
> From d0ed2d2e8e863a9a64c9fc9c08fa68bee546ad00 Mon Sep 17 00:00:00 2001
> From: Anthony Liguori <aliguori@us.ibm.com>
> Date: Mon, 23 Jan 2012 07:30:43 -0600
> Subject: [PATCH 26/26] 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 <aliguori@us.ibm.com>
---
 hw/e1000.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/hw/e1000.c b/hw/e1000.c
index b0542d7..54ade40 100644
--- a/hw/e1000.c
+++ b/hw/e1000.c
@@ -447,6 +447,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);
@@ -462,6 +464,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;
     }






^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2012-01-28 11:45 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-28 11:45 [gentoo-commits] gentoo-x86 commit in app-emulation/qemu/files: qemu-0.11.1-CVE-2012-0029-backport.patch Sergei Trofimovich (slyfox)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox