From: P J P Date: Tue, 15 Sep 2015 11:16:59 +0000 (+0530) Subject: net: avoid infinite loop when receiving packets(CVE-2015-5278) X-Git-Tag: qemu-xen-4.5.2^0 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=e5a1bb22cfb307db909dbd3404c48e5bbeb9e66d;p=qemu-upstream-4.5-testing.git net: avoid infinite loop when receiving packets(CVE-2015-5278) 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. upstream-commit-id: 737d2b3c41d59eb8f94ab7eb419b957938f24943 Reported-by: Qinghao Tang Signed-off-by: P J P Signed-off-by: Stefan Hajnoczi Signed-off-by: Stefano Stabellini --- diff --git a/hw/net/ne2000.c b/hw/net/ne2000.c index 2855d44b0..146d2f871 100644 --- a/hw/net/ne2000.c +++ b/hw/net/ne2000.c @@ -256,7 +256,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;