mopsfelder / rpms / qemu

Forked from rpms/qemu 4 years ago
Clone
5112d72
From: P J P <pjp@fedoraproject.org>
5112d72
Date: Fri, 4 Sep 2015 17:21:06 +0100
5112d72
Subject: [PATCH] e1000: Avoid infinite loop in processing transmit descriptor
5112d72
 (CVE-2015-6815)
5112d72
5112d72
While processing transmit descriptors, it could lead to an infinite
5112d72
loop if 'bytes' was to become zero; Add a check to avoid it.
5112d72
5112d72
[The guest can force 'bytes' to 0 by setting the hdr_len and mss
5112d72
descriptor fields to 0.
5112d72
--Stefan]
5112d72
5112d72
Signed-off-by: P J P <pjp@fedoraproject.org>
5112d72
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
5112d72
Reviewed-by: Thomas Huth <thuth@redhat.com>
5112d72
Message-id: 1441383666-6590-1-git-send-email-stefanha@redhat.com
5112d72
(cherry picked from commit b947ac2bf26479e710489739c465c8af336599e7)
5112d72
---
5112d72
 hw/net/e1000.c | 3 ++-
5112d72
 1 file changed, 2 insertions(+), 1 deletion(-)
5112d72
5112d72
diff --git a/hw/net/e1000.c b/hw/net/e1000.c
5112d72
index 0fc29a0..d41955e 100644
5112d72
--- a/hw/net/e1000.c
5112d72
+++ b/hw/net/e1000.c
5112d72
@@ -708,7 +708,8 @@ process_tx_desc(E1000State *s, struct e1000_tx_desc *dp)
5112d72
                 memmove(tp->data, tp->header, tp->hdr_len);
5112d72
                 tp->size = tp->hdr_len;
5112d72
             }
5112d72
-        } while (split_size -= bytes);
5112d72
+            split_size -= bytes;
5112d72
+        } while (bytes && split_size);
5112d72
     } else if (!tp->tse && tp->cptse) {
5112d72
         // context descriptor TSE is not set, while data descriptor TSE is set
5112d72
         DBGOUT(TXERR, "TCP segmentation error\n");