Skip to content

KVM: kvm_create_vm() bug fixes and cleanup

Sean Christopherson kvm lkml 1 version Applied

Status from this message: Queued, thanks (with the arm/s390 confusion fixed in the last

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 6 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/3KVM: Properly unwind VM creation if creating debugfs failsvirt/kvm/kvm_main.c+8 -81 reply
2/3KVM: Unconditionally get a ref to /dev/kvm module when creating a VMvirt/kvm/kvm_main.c+4 -102 replies
3/3KVM: Move coalesced MMIO initialization (back) into kvm_create_vm()virt/kvm/kvm_main.c+6 -52 replies

Reviews trailers per patch

1 of 3 patches has a Reviewed-by or Acked-by.

PatchOliver Upton
1/3R-b
2/3
3/3

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

Read the v1 thread

Cover letter [PATCH 0/3] KVM: kvm_create_vm() bug fixes and cleanup

Fix two (embarassing) bugs in kvm_create_vm() where KVM fails to properly unwind VM creation, which most often manifests as a not-present page fault due to use-after-free when walking the global vm_list (VM is added and freed, but never removed from the list). Patch 3 is a loosely related clean up.

I discovered the try_get_module() bug by inspection[*]. syzkaller found the debugfs around the same time.

The try_get_module() bug is especially bad/amusing. The "rmmod --wait" behavior KVM is trying to handle was removed ~9 years ago...

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

Sean Christopherson (3):
KVM: Properly unwind VM creation if creating debugfs fails
KVM: Unconditionally get a ref to /dev/kvm module when creating a VM
KVM: Move coalesced MMIO initialization (back) into kvm_create_vm()

 virt/kvm/kvm_main.c | 39 +++++++++++++++++----------------------
 1 file changed, 17 insertions(+), 22 deletions(-)

base-commit: 19a7cc817a380f7a412d7d76e145e9e2bc47e52f

Signature · 1 line
2.37.1.595.g718a3a8f04-goog