KVM: fix vcpu freeing bug
PATCH 1/1 KVM: fix vcpu freeing bug
From: Ingo Molnar <[email protected]>
Subject: [patch] KVM: fix vcpu freeing bug
vcpu_load() can return NULL and it sometimes does in failure paths (for example when the userspace ABI version is too old) - causing a preemption count underflow in the ->vcpu_free() later on. So check for NULL.
drivers/kvm/kvm_main.c +3 -1
@@ -357,7 +357,9 @@ static void kvm_free_physmem(struct kvmstatic void kvm_free_vcpu (struct kvm_vcpu *vcpu) { -vcpu_load (vcpu->kvm,vcpu_slot (vcpu)); +if (!vcpu_load (vcpu->kvm,vcpu_slot (vcpu))) +return ; +kvm_mmu_destroy (vcpu);vcpu_put (vcpu); kvm_arch_ops->vcpu_free (vcpu);
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
A message that is not in the archive (sent off-list or not yet received): [email protected]
Avi Kivity
AppliedQuoted 9 lines · Ingo Molnar
From: Ingo Molnar <[email protected]>
Subject: [patch] KVM: fix vcpu freeing bug
vcpu_load()can return NULL and it sometimes does in failure paths (for example when the userspace ABI version is too old) - causing a preemption count underflow in the ->vcpu_free() later on. So check for NULL.
Applied, thanks.
Signature · 8 lines
error compiling committee.c: too many arguments to function ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV