Commit 2beb6dad authored by Paolo Bonzini's avatar Paolo Bonzini
Browse files

KVM: x86: cleanup the page tracking SRCU instance

SRCU uses a delayed work item.  Skip cleaning it up, and
the result is use-after-free in the work item callbacks.

Reported-by: default avatarDmitry Vyukov <>
Suggested-by: default avatarDmitry Vyukov <>
Fixes: 0eb05bf2

Reviewed-by: default avatarXiao Guangrong <>
Signed-off-by: default avatarPaolo Bonzini <>
parent 7ad658b6
......@@ -46,6 +46,7 @@ struct kvm_page_track_notifier_node {
void kvm_page_track_init(struct kvm *kvm);
void kvm_page_track_cleanup(struct kvm *kvm);
void kvm_page_track_free_memslot(struct kvm_memory_slot *free,
struct kvm_memory_slot *dont);
......@@ -160,6 +160,14 @@ bool kvm_page_track_is_active(struct kvm_vcpu *vcpu, gfn_t gfn,
return !!ACCESS_ONCE(slot->arch.gfn_track[mode][index]);
void kvm_page_track_cleanup(struct kvm *kvm)
struct kvm_page_track_notifier_head *head;
head = &kvm->arch.track_notifier_head;
void kvm_page_track_init(struct kvm *kvm)
struct kvm_page_track_notifier_head *head;
......@@ -8158,6 +8158,7 @@ void kvm_arch_destroy_vm(struct kvm *kvm)
kvfree(rcu_dereference_check(kvm->arch.apic_map, 1));
void kvm_arch_free_memslot(struct kvm *kvm, struct kvm_memory_slot *free,
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment