virtio-balloon: Disable free page reporting if page poison reporting is not enabled
commit81a22eb0304d3a400d57fc1c2b6694a69f62c4c4
authorAlexander Duyck <alexander.h.duyck@linux.intel.com>
Fri, 8 May 2020 17:40:06 +0000 (8 10:40 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 22 Jun 2020 07:33:08 +0000 (22 09:33 +0200)
tree9343a488af8232547ea251adc1620a0694f6213e
parent39b21b529fd986f124f683a61ff1f978a312df4d
virtio-balloon: Disable free page reporting if page poison reporting is not enabled

commit fb69c2c896fc8289b0d9e2c0791472e7cd398bca upstream.

We should disable free page reporting if page poisoning is enabled but we
cannot report it via the balloon interface. This way we can avoid the
possibility of corrupting guest memory. Normally the page poisoning feature
should always be present when free page reporting is enabled on the
hypervisor, however this allows us to correctly handle a case of the
virtio-balloon device being possibly misconfigured.

Fixes: 5d757c8d518d ("virtio-balloon: add support for providing free page reports to host")
Cc: stable@vger.kernel.org
Acked-by: David Hildenbrand <david@redhat.com>
Signed-off-by: Alexander Duyck <alexander.h.duyck@linux.intel.com>
Link: https://lore.kernel.org/r/20200508173732.17877.85060.stgit@localhost.localdomain
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/virtio/virtio_balloon.c