[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 05/15] virtio-ccw: Check indicators location.
From: |
Michael Roth |
Subject: |
[Qemu-devel] [PATCH 05/15] virtio-ccw: Check indicators location. |
Date: |
Tue, 14 May 2013 16:53:02 -0500 |
From: Cornelia Huck <address@hidden>
If a guest neglected to register (secondary) indicators but still runs
with notifications enabled, we might end up writing to guest zero;
avoid this by checking for valid indicators and only writing to the
guest and generating an interrupt if indicators have been setup.
Cc: address@hidden
Signed-off-by: Cornelia Huck <address@hidden>
(cherry picked from commit 7c4869761d7f2e0a3f806a5359eea5d2473ec5d5)
Signed-off-by: Michael Roth <address@hidden>
---
hw/s390x/virtio-ccw.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/hw/s390x/virtio-ccw.c b/hw/s390x/virtio-ccw.c
index d92e427..627d11d 100644
--- a/hw/s390x/virtio-ccw.c
+++ b/hw/s390x/virtio-ccw.c
@@ -662,10 +662,16 @@ static void virtio_ccw_notify(DeviceState *d, uint16_t
vector)
}
if (vector < VIRTIO_PCI_QUEUE_MAX) {
+ if (!dev->indicators) {
+ return;
+ }
indicators = ldq_phys(dev->indicators);
indicators |= 1ULL << vector;
stq_phys(dev->indicators, indicators);
} else {
+ if (!dev->indicators2) {
+ return;
+ }
vector = 0;
indicators = ldq_phys(dev->indicators2);
indicators |= 1ULL << vector;
--
1.7.9.5
- [Qemu-devel] Patch Round-up for stable 1.4.2, freeze on Monday, Michael Roth, 2013/05/14
- [Qemu-devel] [PATCH 01/15] nbd: unlock mutex in nbd_co_send_request() error path, Michael Roth, 2013/05/14
- [Qemu-devel] [PATCH 02/15] qdev: Fix QOM unrealize behavior, Michael Roth, 2013/05/14
- [Qemu-devel] [PATCH 03/15] rng random backend: check for -EAGAIN errors on read, Michael Roth, 2013/05/14
- [Qemu-devel] [PATCH 04/15] tap: properly initialize vhostfds, Michael Roth, 2013/05/14
- [Qemu-devel] [PATCH 05/15] virtio-ccw: Check indicators location.,
Michael Roth <=
- [Qemu-devel] [PATCH 06/15] configure: Pick up libseccomp include path, Michael Roth, 2013/05/14
- [Qemu-devel] [PATCH 07/15] target-mips: Fix accumulator arguments to gen_helper_dmult(u), Michael Roth, 2013/05/14
- [Qemu-devel] [PATCH 08/15] tcg/optimize: fix setcond2 optimization, Michael Roth, 2013/05/14
- [Qemu-devel] [PATCH 09/15] qga: set umask 0077 when daemonizing (CVE-2013-2007), Michael Roth, 2013/05/14
- [Qemu-devel] [PATCH 10/15] tcg: Document tcg_qemu_tb_exec() and provide constants for low bit uses, Michael Roth, 2013/05/14
- [Qemu-devel] [PATCH 11/15] cpu-exec: wrap tcg_qemu_tb_exec() in a fn to restore the PC, Michael Roth, 2013/05/14
- [Qemu-devel] [PATCH 12/15] Handle CPU interrupts by inline checking of a flag, Michael Roth, 2013/05/14
- [Qemu-devel] [PATCH 13/15] translate-all.c: Remove cpu_unlink_tb(), Michael Roth, 2013/05/14
- [Qemu-devel] [PATCH 14/15] qga: distinguish binary modes in "guest_file_open_modes" map, Michael Roth, 2013/05/14
- [Qemu-devel] [PATCH 15/15] qga: unlink just created guest-file if fchmod() or fdopen() fails on it, Michael Roth, 2013/05/14