mirror of
https://github.com/xemu-project/xemu.git
synced 2024-11-24 03:59:52 +00:00
virtio-ccw: Check indicators location.
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: qemu-stable@nongnu.org Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
This commit is contained in:
parent
9953f8822c
commit
7c4869761d
@ -742,10 +742,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;
|
||||
|
Loading…
Reference in New Issue
Block a user