1
0
Fork 0
alistair23-linux/virt/kvm/arm/vgic
Miaohe Lin 0bda9498dd KVM: arm/arm64: vgic: Fix potential double free dist->spis in __kvm_vgic_destroy()
In kvm_vgic_dist_init() called from kvm_vgic_map_resources(), if
dist->vgic_model is invalid, dist->spis will be freed without set
dist->spis = NULL. And in vgicv2 resources clean up path,
__kvm_vgic_destroy() will be called to free allocated resources.
And dist->spis will be freed again in clean up chain because we
forget to set dist->spis = NULL in kvm_vgic_dist_init() failed
path. So double free would happen.

Signed-off-by: Miaohe Lin <linmiaohe@huawei.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Reviewed-by: Eric Auger <eric.auger@redhat.com>
Link: https://lore.kernel.org/r/1574923128-19956-1-git-send-email-linmiaohe@huawei.com
2019-12-06 11:41:29 +00:00
..
trace.h KVM: arm/arm64: vgic: Use the appropriate TRACE_INCLUDE_PATH 2019-09-11 16:36:19 +01:00
vgic-debug.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 234 2019-06-19 17:09:07 +02:00
vgic-init.c KVM: arm/arm64: vgic: Fix potential double free dist->spis in __kvm_vgic_destroy() 2019-12-06 11:41:29 +00:00
vgic-irqfd.c KVM: arm/arm64: vgic-irqfd: Implement kvm_arch_set_irq_inatomic 2019-08-18 18:38:54 +01:00
vgic-its.c KVM: vgic-v4: Track the number of VLPIs per vcpu 2019-11-08 11:13:24 +00:00
vgic-kvm-device.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 174 2019-05-30 11:26:41 -07:00
vgic-mmio-v2.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 174 2019-05-30 11:26:41 -07:00
vgic-mmio-v3.c KVM: arm/arm64: vgic: Use a single IO device per redistributor 2019-08-25 11:02:52 +01:00
vgic-mmio.c arm64 fixes for -rc7 2019-08-28 10:37:21 -07:00
vgic-mmio.h treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 234 2019-06-19 17:09:07 +02:00
vgic-v2.c * s390: ioctl hardening, selftests 2019-09-18 09:49:13 -07:00
vgic-v3.c KVM: arm/arm64: vgic: Don't rely on the wrong pending table 2019-10-29 13:47:39 +00:00
vgic-v4.c KVM: vgic-v4: Track the number of VLPIs per vcpu 2019-11-08 11:13:24 +00:00
vgic.c KVM: arm64: vgic-v4: Move the GICv4 residency flow to be driven by vcpu_load/put 2019-10-28 16:20:58 +00:00
vgic.h KVM: arm64: vgic-v4: Move the GICv4 residency flow to be driven by vcpu_load/put 2019-10-28 16:20:58 +00:00