Skip to content

Commit

Permalink
net: avoid infinite loop when receiving packets(CVE-2015-5278)
Browse files Browse the repository at this point in the history
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 <luodalongde@gmail.com>
Signed-off-by: P J P <pjp@fedoraproject.org>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
  • Loading branch information
P J P authored and stefanhaRH committed Sep 15, 2015
1 parent 9bbdbc6 commit 737d2b3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion hw/net/ne2000.c
Expand Up @@ -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;
Expand Down

0 comments on commit 737d2b3

Please sign in to comment.