diff options
| author | Naveen N Rao (AMD) <naveen@kernel.org> | 2026-09-23 08:51:08 -0700 |
|---|---|---|
| committer | Sean Christopherson <seanjc@google.com> | 2026-09-30 06:40:47 -0700 |
| commit | 88c15bbd43ae95a2c81f3f21a7fd8f4fb0914902 (patch) | |
| tree | e50fe9b8d561f0a803e57087cb9d634cdc866d37 /tools/perf/scripts/python | |
| parent | 12e0d427c335f6f140087def6b2002419ee5f6b0 (diff) | |
KVM: SVM: Clear AVIC Physical ID table entry if vCPU creation fails
If vCPU creation fails after kvm_arch_vcpu_create(), the AVIC Physical
ID table entry corresponding to that vCPU continues to point to the
freed APIC backing page which can result in UAF. Address this by
clearing out the corresponding AVIC Physical ID table entry in the
vcpu_free() callback, similar to the VMX commit b41f2ca6c060 ("KVM: VMX:
Fix stale PID-pointer table entry left after vCPU free").
Though unlikely, it is also possible that svm_vcpu_create() itself fails
after the AVIC Physical ID table entry has been setup if memory
allocation fails in svm_vcpu_alloc_msrpm(). Clear the entry in this path
as well.
Note: this change depends on commit 97d65b544f48 ("KVM: Check for
duplicate vcpu_id as early as possible"), which ensures that a vCPU with
a duplicate ID is never created. Otherwise, a valid AVIC Physical ID
table entry for an existing vCPU will be cleared.
Fixes: 44a95dae1d22 ("KVM: x86: Detect and Initialize AVIC support")
Signed-off-by: Naveen N Rao (AMD) <naveen@kernel.org>
Tested-by: Atish Patra <atishp@meta.com>
[sean: use avic_is_addressable_vcpu()]
Link: https://patch.msgid.link/20260923155108.1550622-4-seanjc@google.com
Signed-off-by: Sean Christopherson <seanjc@google.com>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions
