[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 29/48] ivshmem: error on too many eventfd received
From: |
marcandre . lureau |
Subject: |
[Qemu-devel] [PULL 29/48] ivshmem: error on too many eventfd received |
Date: |
Tue, 6 Oct 2015 21:19:25 +0200 |
From: Marc-André Lureau <address@hidden>
The number of eventfd that can be handled per peer is limited by the
number of vectors. Return an error when receiving too many of them.
Signed-off-by: Marc-André Lureau <address@hidden>
Reviewed-by: Claudio Fontana <address@hidden>
---
hw/misc/ivshmem.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/hw/misc/ivshmem.c b/hw/misc/ivshmem.c
index 0e31d1d..50af4c7 100644
--- a/hw/misc/ivshmem.c
+++ b/hw/misc/ivshmem.c
@@ -571,6 +571,14 @@ static void ivshmem_read(void *opaque, const uint8_t *buf,
int size)
/* each peer has an associated array of eventfds, and we keep
* track of how many eventfds received so far */
/* get a new eventfd: */
+ /* get a new eventfd */
+ if (peer->nb_eventfds >= s->vectors) {
+ error_report("Too many eventfd received, device has %d vectors",
+ s->vectors);
+ close(incoming_fd);
+ return;
+ }
+
new_eventfd = peer->nb_eventfds++;
/* this is an eventfd for a particular peer VM */
--
2.4.3
- [Qemu-devel] [PULL 21/48] ivshmem: use common return, (continued)
- [Qemu-devel] [PULL 21/48] ivshmem: use common return, marcandre . lureau, 2015/10/08
- [Qemu-devel] [PULL 09/48] ivshmem: more qdev conversion, marcandre . lureau, 2015/10/08
- [Qemu-devel] [PULL 48/48] ivshmem: use little-endian int64_t for the protocol, marcandre . lureau, 2015/10/08
- [Qemu-devel] [PULL 06/48] ivshmem: remove unnecessary dup(), marcandre . lureau, 2015/10/08
- [Qemu-devel] [PULL 02/48] msix: add VMSTATE_MSIX_TEST, marcandre . lureau, 2015/10/08
- [Qemu-devel] [PULL 15/48] ivshmem: initialize max_peer to -1, marcandre . lureau, 2015/10/08
- [Qemu-devel] [PULL 18/48] ivshmem: improve error handling, marcandre . lureau, 2015/10/08
- [Qemu-devel] [PULL 25/48] ivshmem: check shm isn't already initialized, marcandre . lureau, 2015/10/08
- [Qemu-devel] [PULL 37/48] contrib: remove unnecessary strdup(), marcandre . lureau, 2015/10/08
- [Qemu-devel] [PULL 47/48] ivshmem: use kvm irqfd for msi notifications, marcandre . lureau, 2015/10/08
- [Qemu-devel] [PULL 29/48] ivshmem: error on too many eventfd received,
marcandre . lureau <=
- [Qemu-devel] [PULL 38/48] msix: implement pba write (but read-only), marcandre . lureau, 2015/10/08
- [Qemu-devel] [PULL 23/48] ivshmem: migrate with VMStateDescription, marcandre . lureau, 2015/10/08
- [Qemu-devel] [PULL 31/48] contrib: add ivshmem client and server, marcandre . lureau, 2015/10/08
- [Qemu-devel] [PULL 20/48] ivshmem: simplify a bit the code, marcandre . lureau, 2015/10/08
- [Qemu-devel] [PULL 22/48] ivshmem: use common is_power_of_2(), marcandre . lureau, 2015/10/08
- [Qemu-devel] [PULL 42/48] ivshmem: do not keep shm_fd open, marcandre . lureau, 2015/10/08
- [Qemu-devel] [PULL 16/48] ivshmem: remove max_peer field, marcandre . lureau, 2015/10/08
- [Qemu-devel] [PULL 36/48] ivshmem: add check on protocol version in QEMU, marcandre . lureau, 2015/10/08
- Re: [Qemu-devel] [PULL 00/48] ivshmem series, Andreas Färber, 2015/10/08