]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
KVM: arm64: Don't leak stage-2 page-table if VM fails to init under pKVM
authorWill Deacon <will@kernel.org>
Mon, 30 Mar 2026 14:48:03 +0000 (15:48 +0100)
committerMarc Zyngier <maz@kernel.org>
Mon, 30 Mar 2026 15:58:07 +0000 (16:58 +0100)
commit5e66f723d4de432a5acb481293d81dc88c7f61a4
tree9a0ac3c2cb6a047d219f23a041c583a721c3cdf9
parent660b208e8b5ea0f5a68a8333e18960d89d484a27
KVM: arm64: Don't leak stage-2 page-table if VM fails to init under pKVM

If pkvm_init_host_vm() fails, we should free the stage-2 page-table
previously allocated by kvm_init_stage2_mmu().

Cc: Fuad Tabba <tabba@google.com>
Reviewed-by: Fuad Tabba <tabba@google.com>
Tested-by: Fuad Tabba <tabba@google.com>
Tested-by: Mostafa Saleh <smostafa@google.com>
Fixes: 07aeb70707b1 ("KVM: arm64: Reserve pKVM handle during pkvm_init_host_vm()")
Signed-off-by: Will Deacon <will@kernel.org>
Link: https://patch.msgid.link/20260330144841.26181-3-will@kernel.org
Signed-off-by: Marc Zyngier <maz@kernel.org>
arch/arm64/kvm/arm.c