Re: [bug report] kvm: mmu: Don't expose private memslots to L2

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Dan,

The value of 'map_writable' shouldn't be used when the pfn is
KVM_PFN_NOSLOT. That would be a bug. Can you show me the path on which
it is used?



On Thu, May 17, 2018 at 6:40 AM, Dan Carpenter <dan.carpenter@xxxxxxxxxx> wrote:
> Hello Jim Mattson,
>
> The patch 3a2936dedd20: "kvm: mmu: Don't expose private memslots to
> L2" from May 9, 2018, leads to the following static checker warning:
>
>         arch/x86/kvm/mmu.c:3334 nonpaging_map()
>         error: uninitialized symbol 'map_writable'.
>
> arch/x86/kvm/mmu.c
>   3315          if (fast_page_fault(vcpu, v, level, error_code))
>   3316                  return RET_PF_RETRY;
>   3317
>   3318          mmu_seq = vcpu->kvm->mmu_notifier_seq;
>   3319          smp_rmb();
>   3320
>   3321          if (try_async_pf(vcpu, prefault, gfn, v, &pfn, write, &map_writable))
>                                                                        ^^^^^^^^^^^^
> After that patch we return false but don't initialize *writable.
>
>   3322                  return RET_PF_RETRY;
>   3323
>   3324          if (handle_abnormal_pfn(vcpu, v, gfn, pfn, ACC_ALL, &r))
>   3325                  return r;
>   3326
>   3327          spin_lock(&vcpu->kvm->mmu_lock);
>   3328          if (mmu_notifier_retry(vcpu->kvm, mmu_seq))
>   3329                  goto out_unlock;
>   3330          if (make_mmu_pages_available(vcpu) < 0)
>   3331                  goto out_unlock;
>   3332          if (likely(!force_pt_level))
>   3333                  transparent_hugepage_adjust(vcpu, &gfn, &pfn, &level);
>   3334          r = __direct_map(vcpu, write, map_writable, level, gfn, pfn, prefault);
>                                               ^^^^^^^^^^^^
>
>   3335          spin_unlock(&vcpu->kvm->mmu_lock);
>
> regards,
> dan carpenter



[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux