[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 1/8] virtio: validate the existence of handle_output
From: |
Michael S. Tsirkin |
Subject: |
[Qemu-devel] [PULL 1/8] virtio: validate the existence of handle_output before calling it |
Date: |
Wed, 18 Mar 2015 13:34:35 +0100 |
From: Jason Wang <address@hidden>
We don't validate the existence of handle_output which may let a buggy
guest to trigger a SIGSEV easily. E.g:
1) write 10 to queue_sel to a virtio net device with only 1 queue
2) setup an arbitrary pfn
3) then notify queue 10
Fixing this by validating the existence of handle_output before.
Cc: address@hidden
Cc: Michael S. Tsirkin <address@hidden>
Signed-off-by: Jason Wang <address@hidden>
Reviewed-by: Michael S. Tsirkin <address@hidden>
Signed-off-by: Michael S. Tsirkin <address@hidden>
Reviewed-by: Don Koch <address@hidden>
Reviewed-by: Fam Zheng <address@hidden>
---
hw/virtio/virtio.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/hw/virtio/virtio.c b/hw/virtio/virtio.c
index 3c6e430..17c1260 100644
--- a/hw/virtio/virtio.c
+++ b/hw/virtio/virtio.c
@@ -759,8 +759,9 @@ void virtio_queue_set_align(VirtIODevice *vdev, int n, int
align)
void virtio_queue_notify_vq(VirtQueue *vq)
{
- if (vq->vring.desc) {
+ if (vq->vring.desc && vq->handle_output) {
VirtIODevice *vdev = vq->vdev;
+
trace_virtio_queue_notify(vdev, vq - vdev->vq, vq);
vq->handle_output(vdev, vq);
}
--
MST
- [Qemu-devel] [PULL 0/8] pci, virtio bugfixes for 2.3, Michael S. Tsirkin, 2015/03/18
- [Qemu-devel] [PULL 1/8] virtio: validate the existence of handle_output before calling it,
Michael S. Tsirkin <=
- [Qemu-devel] [PULL 4/8] aer: fix wrong check on expose aer tlp prefix log, Michael S. Tsirkin, 2015/03/18
- [Qemu-devel] [PULL 2/8] virtio: Fix memory leaks reported by Coverity, Michael S. Tsirkin, 2015/03/18
- [Qemu-devel] [PULL 5/8] pcie_aer: fix typos in pcie_aer_inject_error comment, Michael S. Tsirkin, 2015/03/18
- [Qemu-devel] [PULL 8/8] pcie_aer: fix comment to match pcie spec, Michael S. Tsirkin, 2015/03/18
- [Qemu-devel] [PULL 3/8] pcie: correct mistaken register bit for End-End TLP Prefix Blocking, Michael S. Tsirkin, 2015/03/18
- [Qemu-devel] [PULL 7/8] pci: fix several trivial typos in comment, Michael S. Tsirkin, 2015/03/18
- [Qemu-devel] [PULL 6/8] aer: fix a wrong init PCI_ERR_COR_STATUS w1cmask type register, Michael S. Tsirkin, 2015/03/18
- Re: [Qemu-devel] [PULL 0/8] pci, virtio bugfixes for 2.3, Peter Maydell, 2015/03/19