[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 24/39] ivshmem: check shm isn't already initialized
From: |
Marc-André Lureau |
Subject: |
[Qemu-devel] [PATCH 24/39] ivshmem: check shm isn't already initialized |
Date: |
Fri, 26 Jun 2015 16:49:30 +0200 |
The server should not be allowed to change the shm, this isn't handled
by qemu (perhaps it could be though).
Signed-off-by: Marc-André Lureau <address@hidden>
---
hw/misc/ivshmem.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/hw/misc/ivshmem.c b/hw/misc/ivshmem.c
index 9085f7c..b8167d9 100644
--- a/hw/misc/ivshmem.c
+++ b/hw/misc/ivshmem.c
@@ -534,6 +534,12 @@ static void ivshmem_read(void *opaque, const uint8_t *buf,
int size)
if (incoming_posn == -1) {
void * map_ptr;
+ if (s->shm_fd >= 0) {
+ error_report("shm already initialized");
+ close(incoming_fd);
+ return;
+ }
+
if (check_shm_size(s, incoming_fd, &err) == -1) {
error_report_err(err);
close(incoming_fd);
--
2.4.3
- [Qemu-devel] [PATCH 12/39] ivshmem: remove useless ivshmem_update_irq() val argument, (continued)
- [Qemu-devel] [PATCH 12/39] ivshmem: remove useless ivshmem_update_irq() val argument, Marc-André Lureau, 2015/06/26
- [Qemu-devel] [PATCH 14/39] ivshmem: remove max_peer field, Marc-André Lureau, 2015/06/26
- [Qemu-devel] [PATCH 15/39] ivshmem: improve debug messages, Marc-André Lureau, 2015/06/26
- [Qemu-devel] [PATCH 16/39] ivshmem: improve error, Marc-André Lureau, 2015/06/26
- [Qemu-devel] [PATCH 17/39] ivshmem: print error on invalid peer id, Marc-André Lureau, 2015/06/26
- [Qemu-devel] [PATCH 18/39] ivshmem: add a warning if eventfd value is 0, Marc-André Lureau, 2015/06/26
- [Qemu-devel] [PATCH 19/39] ivshmem: beautify a bit the code, Marc-André Lureau, 2015/06/26
- [Qemu-devel] [PATCH 20/39] ivshmem: use common return, Marc-André Lureau, 2015/06/26
- [Qemu-devel] [PATCH 22/39] ivshmem: migrate with VMStateDescription, Marc-André Lureau, 2015/06/26
- [Qemu-devel] [PATCH 21/39] ivshmem: use common is_power_of_2(), Marc-André Lureau, 2015/06/26
- [Qemu-devel] [PATCH 24/39] ivshmem: check shm isn't already initialized,
Marc-André Lureau <=
- [Qemu-devel] [PATCH 23/39] ivshmem: shmfd can be 0, Marc-André Lureau, 2015/06/26
- [Qemu-devel] [PATCH 25/39] ivshmem: add device description, Marc-André Lureau, 2015/06/26
- [Qemu-devel] [PATCH 26/39] ivshmem: fix pci_ivshmem_exit(), Marc-André Lureau, 2015/06/26
- [Qemu-devel] [PATCH 28/39] ivshmem: error on too many eventfd received, Marc-André Lureau, 2015/06/26
- [Qemu-devel] [PATCH 27/39] ivshmem: replace 'guest' for 'peer' appropriately, Marc-André Lureau, 2015/06/26
- [Qemu-devel] [PATCH 29/39] ivshmem: reset mask on device reset, Marc-André Lureau, 2015/06/26
- [Qemu-devel] [PATCH 31/39] ivshmem-client: check the number of vectors, Marc-André Lureau, 2015/06/26
- [Qemu-devel] [PATCH 32/39] ivshmem-server: use a uint16 for client ID, Marc-André Lureau, 2015/06/26
- [Qemu-devel] [PATCH 33/39] ivshmem-server: include necessary headers, Marc-André Lureau, 2015/06/26
- [Qemu-devel] [PATCH 30/39] contrib: add ivshmem client and server, Marc-André Lureau, 2015/06/26