Skip to content

KVM: SVM: Fix a (very) unlikely UAF for GA Log IRQs

Sean Christopherson kvm lkml sashiko-reviews 2 versions – Applied

Status from this message: Applied to kvm-x86 svm, and I even remembered to drop the avic_vm_init()

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest3 patches 6 repliesApplied
  2. v12 patches 4 repliesSuperseded

Changes in v2 from the cover letter

- Defer adding the VM to the GA Log list until a vCPU is created (KVM only needs GA Lot notifications to wake blocking vCPUs), so that removing the VM from the list can be done during pre-destroy without having to handle the scenario where VM creation fails at a later stage. [Sashiko, Xiao]
- Drop the stable@ tag, as it's not clear to me that the bug can actually occur in the wild, whereas the changes themselves are somewhat risky.

Patches in v2 Applied

#Subject and filesSizeRepliesApplied
1/3KVM: SVM: Make kvm_x86_ops.vcpu_precreate() hook fully AVIC specificarch/x86/kvm/svm/avic.c arch/x86/kvm/svm/svm.c arch/x86/kvm/svm/svm.h+12 -111 reply
2/3KVM: SVM: Do all per-VM AVIC initialization during vCPU precreation phasearch/x86/kvm/svm/avic.c arch/x86/kvm/svm/svm.c+57 -432 replies
3/3KVM: SVM: Remove VM from the GA Log notifier list before VM destructionarch/x86/kvm/svm/avic.c arch/x86/kvm/svm/svm.c arch/x86/kvm/svm/svm.h+15 -72 replies

Reviews trailers per patch

All 3 patches have a Reviewed-by or Acked-by.

PatchNaveen N Rao (AMD)
1/3R-b
2/3R-b
3/3R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 0/3] KVM: SVM: Fix a (very) unlikely UAF for GA Log IRQs

Fix a potential UAF due to freeing vCPUs while they're still reachable through the global hashed list used to handle GA Log notifications.

v2:
- Defer adding the VM to the GA Log list until a vCPU is created (KVM only needs GA Lot notifications to wake blocking vCPUs), so that removing the VM from the list can be done during pre-destroy without having to handle the scenario where VM creation fails at a later stage. [Sashiko, Xiao]
- Drop the stable@ tag, as it's not clear to me that the bug can actually occur in the wild, whereas the changes themselves are somewhat risky.

v1: https://lore.kernel.org/all/[email protected]

Sean Christopherson (3):
KVM: SVM: Make kvm_x86_ops.vcpu_precreate() hook fully AVIC specific
KVM: SVM: Do all per-VM AVIC initialization during vCPU precreation
phase
KVM: SVM: Remove VM from the GA Log notifier list before VM
destruction

 arch/x86/kvm/svm/avic.c | 96 +++++++++++++++++++++++++++--------------
 arch/x86/kvm/svm/svm.c  | 16 ++-----
 arch/x86/kvm/svm/svm.h  |  3 +-
 3 files changed, 69 insertions(+), 46 deletions(-)

base-commit: a204badd8432f93b7e862e7dac6db0fe3d65f370

Signature · 1 line
2.55.0.rc0.799.gd6f94ed593-goog