linux/drivers/virtio
Minchan Kim 9f0f48350a virtio_balloon: fix race by fill and leak
commit f68b992bbb upstream.

During my compaction-related stuff, I encountered a bug
with ballooning.

With repeated inflating and deflating cycle, guest memory(
ie, cat /proc/meminfo | grep MemTotal) is decreased and
couldn't be recovered.

The reason is balloon_lock doesn't cover release_pages_balloon
so struct virtio_balloon fields could be overwritten by race
of fill_balloon(e,g, vb->*pfns could be critical).

This patch fixes it in my test.

Signed-off-by: Minchan Kim <minchan@kernel.org>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
[ luis: backported to 3.16: adjusted context ]
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
History 2016-02-02 19:09:32 +00:00
..
config.c Remove all #inclusions of asm/system.h 2012-03-28 18:30:03 +01:00
Kconfig drivers/virtio: remove depends on CONFIG_EXPERIMENTAL 2013-01-11 11:39:04 -08:00
Makefile virtio: remove CONFIG_VIRTIO_RING 2012-09-28 15:05:15 +09:30
virtio.c virtio: fix memory leak of virtio ida cache layers 2016-01-11 10:50:18 +00:00
virtio_balloon.c virtio_balloon: fix race by fill and leak 2016-02-02 19:09:32 +00:00
virtio_mmio.c virtio: mmio: fix signature checking for BE guests 2013-11-07 12:13:04 +10:30
virtio_pci.c virtio_pci: Clear stale cpumask when setting irq affinity 2015-06-30 17:15:20 +01:00
virtio_ring.c virtio: virtio_break_device() to mark all virtqueues broken. 2014-04-28 11:34:13 +09:30