[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 3/3] net: avoid infinite loop when receiving packets(
From: |
Stefan Hajnoczi |
Subject: |
[Qemu-devel] [PULL 3/3] net: avoid infinite loop when receiving packets(CVE-2015-5278) |
Date: |
Tue, 15 Sep 2015 13:02:31 +0100 |
From: P J P <address@hidden>
Ne2000 NIC uses ring buffer of NE2000_MEM_SIZE(49152)
bytes to process network packets. While receiving packets
via ne2000_receive() routine, a local 'index' variable
could exceed the ring buffer size, leading to an infinite
loop situation.
Reported-by: Qinghao Tang <address@hidden>
Signed-off-by: P J P <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>
---
hw/net/ne2000.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/net/ne2000.c b/hw/net/ne2000.c
index 3798a3b..010f9ef 100644
--- a/hw/net/ne2000.c
+++ b/hw/net/ne2000.c
@@ -247,7 +247,7 @@ ssize_t ne2000_receive(NetClientState *nc, const uint8_t
*buf, size_t size_)
if (index <= s->stop)
avail = s->stop - index;
else
- avail = 0;
+ break;
len = size;
if (len > avail)
len = avail;
--
2.4.3