[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v5 25/48] ivshmem: check shm isn't already initializ
From: |
marcandre . lureau |
Subject: |
[Qemu-devel] [PATCH v5 25/48] ivshmem: check shm isn't already initialized |
Date: |
Fri, 2 Oct 2015 21:09:28 +0200 |
From: Marc-André Lureau <address@hidden>
The server should not change the shm, and this isn't handled by qemu and
we should should verify this in qemu.
Signed-off-by: Marc-André Lureau <address@hidden>
Reviewed-by: Claudio Fontana <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 d3d0204..9023f95 100644
--- a/hw/misc/ivshmem.c
+++ b/hw/misc/ivshmem.c
@@ -533,6 +533,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 v5 08/48] ivshmem: remove useless doorbell field, (continued)
- [Qemu-devel] [PATCH v5 08/48] ivshmem: remove useless doorbell field, marcandre . lureau, 2015/10/08
- [Qemu-devel] [PATCH v5 27/48] ivshmem: fix pci_ivshmem_exit(), marcandre . lureau, 2015/10/08
- [Qemu-devel] [PATCH v5 41/48] tests: add ivshmem qtest, marcandre . lureau, 2015/10/08
- [Qemu-devel] [PATCH v5 35/48] docs: update ivshmem device spec, marcandre . lureau, 2015/10/08
- [Qemu-devel] [PATCH v5 12/48] ivshmem: simplify around increase_dynamic_storage(), marcandre . lureau, 2015/10/08
- [Qemu-devel] [PATCH v5 01/48] char: add qemu_chr_free(), marcandre . lureau, 2015/10/08
- [Qemu-devel] [PATCH v5 13/48] ivshmem: allocate eventfds in resize_peers(), marcandre . lureau, 2015/10/08
- [Qemu-devel] [PATCH v5 19/48] ivshmem: print error on invalid peer id, marcandre . lureau, 2015/10/08
- [Qemu-devel] [PATCH v5 16/48] ivshmem: remove max_peer field, marcandre . lureau, 2015/10/08
- [Qemu-devel] [PATCH v5 25/48] ivshmem: check shm isn't already initialized,
marcandre . lureau <=
- [Qemu-devel] [PATCH v5 18/48] ivshmem: improve error handling, marcandre . lureau, 2015/10/08
- [Qemu-devel] [PATCH v5 20/48] ivshmem: simplify a bit the code, marcandre . lureau, 2015/10/08
- [Qemu-devel] [PATCH v5 30/48] ivshmem: reset mask on device reset, marcandre . lureau, 2015/10/08
- [Qemu-devel] [PATCH v5 28/48] ivshmem: replace 'guest' for 'peer' appropriately, marcandre . lureau, 2015/10/08
- [Qemu-devel] [PATCH v5 37/48] contrib: remove unnecessary strdup(), marcandre . lureau, 2015/10/08
- [Qemu-devel] [PATCH v5 42/48] ivshmem: do not keep shm_fd open, marcandre . lureau, 2015/10/08
- [Qemu-devel] [PATCH v5 38/48] msix: implement pba write (but read-only), marcandre . lureau, 2015/10/08
- [Qemu-devel] [PATCH v5 45/48] ivshmem: remove EventfdEntry.vector, marcandre . lureau, 2015/10/08
- [Qemu-devel] [PATCH v5 48/48] ivshmem: use little-endian int64_t for the protocol, marcandre . lureau, 2015/10/08