projects
/
qemu.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
86d471b
)
ivshmem: check shm isn't already initialized
author
Marc-André Lureau
<marcandre.lureau@redhat.com>
Tue, 23 Jun 2015 10:55:41 +0000
(12:55 +0200)
committer
Marc-André Lureau
<marcandre.lureau@redhat.com>
Sat, 24 Oct 2015 16:02:49 +0000
(18:02 +0200)
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 <marcandre.lureau@redhat.com>
Reviewed-by: Claudio Fontana <claudio.fontana@huawei.com>
hw/misc/ivshmem.c
patch
|
blob
|
history
diff --git
a/hw/misc/ivshmem.c
b/hw/misc/ivshmem.c
index d3d02048cd14fa1595aa98769ccd2346cdf38b0d..9023f95711466a4bb00ebffac32fb4cf3d71f196 100644
(file)
--- 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);