]> git.proxmox.com Git - mirror_qemu.git/commit
virtio: destroy region cache during reset
authorJason Wang <jasowang@redhat.com>
Wed, 15 Mar 2017 11:48:31 +0000 (19:48 +0800)
committerMichael S. Tsirkin <mst@redhat.com>
Wed, 15 Mar 2017 17:37:19 +0000 (19:37 +0200)
commite0e2d644096c79a71099b176d08f465f6803a8b1
tree42fa2c2a31fc6f9ad7c845dab82010b712413729
parent168e4af3c129534ee7d81edc238a9aa9ca0dd474
virtio: destroy region cache during reset

We don't destroy region cache during reset which can make the maps
of previous driver leaked to a buggy or malicious driver that don't
set vring address before starting to use the device. Fix this by
destroy the region cache during reset and validate it before trying to
see them.

Cc: Cornelia Huck <cornelia.huck@de.ibm.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
Reviewed-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
hw/virtio/virtio.c