linux-stable/drivers/virtio
Arnd Bergmann f0bb2d50df virtio_balloon: prevent uninitialized variable use
The latest gcc-7.0.1 snapshot reports a new warning:

virtio/virtio_balloon.c: In function 'update_balloon_stats':
virtio/virtio_balloon.c:258:26: error: 'events[2]' is used uninitialized in this function [-Werror=uninitialized]
virtio/virtio_balloon.c:260:26: error: 'events[3]' is used uninitialized in this function [-Werror=uninitialized]
virtio/virtio_balloon.c:261:56: error: 'events[18]' is used uninitialized in this function [-Werror=uninitialized]
virtio/virtio_balloon.c:262:56: error: 'events[17]' is used uninitialized in this function [-Werror=uninitialized]

This seems absolutely right, so we should add an extra check to
prevent copying uninitialized stack data into the statistics.
>From all I can tell, this has been broken since the statistics code
was originally added in 2.6.34.

Fixes: 9564e138b1 ("virtio: Add memory statistics reporting to the balloon driver (V4)")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Ladi Prosek <lprosek@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2017-03-28 20:41:28 +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: prevent uninitialized variable use 2017-03-28 20:41:28 +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