• Oleg Nesterov's avatar
    KVM: async_pf: mm->mm_users can not pin apf->mm · 41c22f62
    Oleg Nesterov authored
    get_user_pages(mm) is simply wrong if mm->mm_users == 0 and exit_mmap/etc
    was already called (or is in progress), mm->mm_count can only pin mm->pgd
    and mm_struct itself.
    
    Change kvm_setup_async_pf/async_pf_execute to inc/dec mm->mm_users.
    
    kvm_create_vm/kvm_destroy_vm play with ->mm_count too but this case looks
    fine at first glance, it seems that this ->mm is only used to verify that
    current->mm == kvm->mm.
    Signed-off-by: default avatarOleg Nesterov <oleg@redhat.com>
    Cc: stable@vger.kernel.org
    Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
    41c22f62
async_pf.c 5.46 KB