linux-stable/drivers/virtio
Ladi Prosek fc8653228c virtio_balloon: init 1st buffer in stats vq
When init_vqs runs, virtio_balloon.stats is either uninitialized or
contains stale values. The host updates its state with garbage data
because it has no way of knowing that this is just a marker buffer
used for signaling.

This patch updates the stats before pushing the initial buffer.

Alternative fixes:
* Push an empty buffer in init_vqs. Not easily done with the current
  virtio implementation and violates the spec "Driver MUST supply the
  same subset of statistics in all buffers submitted to the statsq".
* Push a buffer with invalid tags in init_vqs. Violates the same
  spec clause, plus "invalid tag" is not really defined.

Note: the spec says:
	When using the legacy interface, the device SHOULD ignore all values in
	the first buffer in the statsq supplied by the driver after device
	initialization. Note: Historically, drivers supplied an uninitialized
	buffer in the first buffer.

Unfortunately QEMU does not seem to implement the recommendation
even for the legacy interface.

Cc: stable@vger.kernel.org
Signed-off-by: Ladi Prosek <lprosek@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2017-03-28 20:41:27 +03:00
..
Kconfig docs: fix locations of several documents that got moved 2016-10-24 08:12:35 -02:00
Makefile Add virtio-input driver. 2015-03-29 12:13:52 +10:30
virtio.c virtio_net: refactor freeze/restore logic into virtnet reset logic 2017-02-07 10:05:12 -05:00
virtio_balloon.c virtio_balloon: init 1st buffer in stats vq 2017-03-28 20:41:27 +03:00
virtio_input.c virtio: allow drivers to request IRQ affinity when creating VQs 2017-02-27 20:54:04 +02:00
virtio_mmio.c virtio: allow drivers to request IRQ affinity when creating VQs 2017-02-27 20:54:04 +02:00
virtio_pci_common.c virtio_pci: fix out of bound access for msix_names 2017-03-28 20:40:53 +03:00
virtio_pci_common.h virtio: provide a method to get the IRQ affinity mask for a virtqueue 2017-02-27 20:54:05 +02:00
virtio_pci_legacy.c virtio: provide a method to get the IRQ affinity mask for a virtqueue 2017-02-27 20:54:05 +02:00
virtio_pci_modern.c virtio: provide a method to get the IRQ affinity mask for a virtqueue 2017-02-27 20:54:05 +02:00
virtio_ring.c Revert "vring: Force use of DMA API for ARM-based systems with legacy devices" 2017-02-03 23:38:50 +02:00