linux-yocto/arch/arm64/kvm
Will Deacon c322789613 KVM: arm64: Tear down vGIC on failed vCPU creation
commit 250f25367b upstream.

If kvm_arch_vcpu_create() fails to share the vCPU page with the
hypervisor, we propagate the error back to the ioctl but leave the
vGIC vCPU data initialised. Note only does this leak the corresponding
memory when the vCPU is destroyed but it can also lead to use-after-free
if the redistributor device handling tries to walk into the vCPU.

Add the missing cleanup to kvm_arch_vcpu_create(), ensuring that the
vGIC vCPU structures are destroyed on error.

Cc: <stable@vger.kernel.org>
Cc: Marc Zyngier <maz@kernel.org>
Cc: Oliver Upton <oliver.upton@linux.dev>
Cc: Quentin Perret <qperret@google.com>
Signed-off-by: Will Deacon <will@kernel.org>
Reviewed-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20250314133409.9123-1-will@kernel.org
Signed-off-by: Oliver Upton <oliver.upton@linux.dev>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-04-20 10:15:34 +02:00
..
hyp KVM: arm64: Eagerly switch ZCR_EL{1,2} 2025-03-28 22:03:32 +01:00
vgic KVM: arm64: vgic-its: Clear DTE when MAPD unmaps a device 2024-12-05 14:02:45 +01:00
.gitignore
arch_timer.c KVM: arm64: timer: Always evaluate the need for a soft timer 2025-02-17 10:05:05 +01:00
arm.c KVM: arm64: Tear down vGIC on failed vCPU creation 2025-04-20 10:15:34 +02:00
at.c KVM: arm64: nv: Add support for FEAT_ATS1A 2024-08-30 12:04:20 +01:00
debug.c KVM: arm64: debug: fix kernel-doc warnings 2024-02-01 20:25:41 +00:00
emulate-nested.c Merge branch kvm-arm64/nv-at-pan into kvmarm-master/next 2024-09-12 08:37:47 +01:00
fpsimd.c KVM: arm64: Eagerly switch ZCR_EL{1,2} 2025-03-28 22:03:32 +01:00
guest.c KVM: arm64: Disallow copying MTE to guest memory while KVM is dirty logging 2024-08-13 19:29:17 +01:00
handle_exit.c Merge branch kvm-arm64/nv-sve into kvmarm/next 2024-07-14 00:27:06 +00:00
hypercalls.c KVM: arm64: Use kvm_has_feat() to check if FEAT_SSBS is advertised to the guest 2024-08-25 17:48:44 +01:00
inject_fault.c KVM: arm64: Fix typos 2024-02-24 09:13:33 +00:00
Kconfig Merge branch kvm-arm64/s2-ptdump into kvmarm-master/next 2024-09-12 08:38:02 +01:00
Makefile Merge branch kvm-arm64/s2-ptdump into kvmarm-master/next 2024-09-12 08:38:02 +01:00
mmio.c KVM: arm64: Don't retire aborted MMIO instruction 2024-12-05 14:02:44 +01:00
mmu.c KVM: arm64: nv: Do not block when unmapping stage-2 if disallowed 2024-10-08 10:40:27 +01:00
nested.c KVM: arm64: nv: Punt stage-2 recycling to a vCPU request 2024-10-08 10:40:27 +01:00
pauth.c KVM: arm64: nv: Work around lack of pauth support in old toolchains 2024-04-23 19:27:11 +01:00
pkvm.c KVM: arm64: Prevent kmemleak from accessing .hyp.data 2024-05-01 16:48:14 +01:00
pmu-emul.c KVM: arm64: Ignore PMCNTENSET_EL0 while checking for overflow status 2024-12-05 14:02:44 +01:00
pmu.c perf: arm_pmuv3: Add support for Armv9.4 PMU instruction counter 2024-08-16 13:09:12 +01:00
psci.c
ptdump.c KVM: arm64: Register ptdump with debugfs on guest creation 2024-09-10 21:32:51 +01:00
pvtime.c
reset.c KVM: arm64: nv: Support multiple nested Stage-2 mmu structures 2024-06-19 08:13:49 +00:00
stacktrace.c
sys_regs.c KVM: arm64: Do not allow ID_AA64MMFR0_EL1.ASIDbits to be overridden 2024-12-27 14:02:06 +01:00
sys_regs.h Merge branch kvm-arm64/visibility-cleanups into kvmarm-master/next 2024-09-12 08:38:17 +01:00
trace_arm.h
trace_handle_exit.h
trace.h
trng.c
va_layout.c
vgic-sys-reg-v3.c
vmid.c KVM: arm64: Ensure a VMID is allocated before programming VTTBR_EL2 2025-03-07 18:25:37 +01:00