[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 16/35] net: ne2000: check ring buffer control regist
From: |
Michael Roth |
Subject: |
[Qemu-devel] [PATCH 16/35] net: ne2000: check ring buffer control registers |
Date: |
Mon, 21 Mar 2016 12:28:14 -0500 |
From: Prasad J Pandit <address@hidden>
Ne2000 NIC uses ring buffer of NE2000_MEM_SIZE(49152)
bytes to process network packets. Registers PSTART & PSTOP
define ring buffer size & location. Setting these registers
to invalid values could lead to infinite loop or OOB r/w
access issues. Add check to avoid it.
Reported-by: Yang Hongke <address@hidden>
Tested-by: Yang Hongke <address@hidden>
Signed-off-by: Prasad J Pandit <address@hidden>
Signed-off-by: Jason Wang <address@hidden>
(cherry picked from commit 415ab35a441eca767d033a2702223e785b9d5190)
Signed-off-by: Michael Roth <address@hidden>
---
hw/net/ne2000.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/hw/net/ne2000.c b/hw/net/ne2000.c
index 010f9ef..84a7263 100644
--- a/hw/net/ne2000.c
+++ b/hw/net/ne2000.c
@@ -154,6 +154,10 @@ static int ne2000_buffer_full(NE2000State *s)
{
int avail, index, boundary;
+ if (s->stop <= s->start) {
+ return 1;
+ }
+
index = s->curpag << 8;
boundary = s->boundary << 8;
if (index < boundary)
--
1.9.1
- [Qemu-devel] [PATCH 09/35] ivshmem: no need for opaque argument, (continued)
- [Qemu-devel] [PATCH 09/35] ivshmem: no need for opaque argument, Michael Roth, 2016/03/21
- [Qemu-devel] [PATCH 11/35] net: rocker: fix an incorrect array bounds check, Michael Roth, 2016/03/21
- [Qemu-devel] [PATCH 17/35] net: set endianness on all backend devices, Michael Roth, 2016/03/21
- [Qemu-devel] [PATCH 13/35] blockdev: Fix 'change' for slot devices, Michael Roth, 2016/03/21
- [Qemu-devel] [PATCH 14/35] net/dump: fix nfds->filename leak, Michael Roth, 2016/03/21
- [Qemu-devel] [PATCH 18/35] ehci: update irq on reset, Michael Roth, 2016/03/21
- [Qemu-devel] [PATCH 19/35] block/raw-posix: avoid bogus fixup for cylinders on DASD disks, Michael Roth, 2016/03/21
- [Qemu-devel] [PATCH 01/35] ehci: make idt processing more robust, Michael Roth, 2016/03/21
- [Qemu-devel] [PATCH 21/35] s390x/css: fix control flags during csch, Michael Roth, 2016/03/21
- [Qemu-devel] [PATCH 15/35] net/filter: fix nf->netdev_id leak, Michael Roth, 2016/03/21
- [Qemu-devel] [PATCH 16/35] net: ne2000: check ring buffer control registers,
Michael Roth <=
- [Qemu-devel] [PATCH 24/35] qmp: Fix reference-counting of qnull on empty output visit, Michael Roth, 2016/03/21
- [Qemu-devel] [PATCH 23/35] cpus: use broadcast on qemu_pause_cond, Michael Roth, 2016/03/21
- [Qemu-devel] [PATCH 20/35] s390x/ioinst: set type and len for SEI response, Michael Roth, 2016/03/21
- [Qemu-devel] [PATCH 27/35] e1000: eliminate infinite loops on out-of-bounds transfer start, Michael Roth, 2016/03/21
- [Qemu-devel] [PATCH 26/35] block: qemu-iotests - add test for snapshot, commit, snapshot bug, Michael Roth, 2016/03/21
- [Qemu-devel] [PATCH 25/35] block: set device_list.tqe_prev to NULL on BDS removal, Michael Roth, 2016/03/21
- [Qemu-devel] [PATCH 29/35] hw/virtio: fix double use of a virtio flag, Michael Roth, 2016/03/21
- [Qemu-devel] [PATCH 32/35] vhost-user: don't merge regions with different fds, Michael Roth, 2016/03/21
- [Qemu-devel] [PATCH 30/35] hw/virtio: group virtio flags into an enum, Michael Roth, 2016/03/21
- [Qemu-devel] [PATCH 31/35] fw_cfg: unbreak migration compatibility for 2.4 and earlier machines, Michael Roth, 2016/03/21