Re: [PATCH 2/3] KVM: Check validity of offset+length of gfn_to_pfn_cache prior to activation

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


On 20/03/2024 00:15, Sean Christopherson wrote:
When activating a gfn_to_pfn_cache, verify that the offset+length is sane
and usable before marking the cache active.  Letting __kvm_gpc_refresh()
detect the problem results in a cache being marked active without setting
the GPA (or any other fields), which in turn results in KVM trying to
refresh a cache with INVALID_GPA.

Attempting to refresh a cache with INVALID_GPA isn't functionally
problematic, but it runs afoul of the sanity check that exactly one of
GPA or userspace HVA is valid, i.e. that a cache is either GPA-based or

Reported-by: syzbot+106a4f72b0474e1d1b33@xxxxxxxxxxxxxxxxxxxxxxxxx
Fixes: 721f5b0dda78 ("KVM: pfncache: allow a cache to be activated with a fixed (userspace) HVA")
Cc: David Woodhouse <dwmw2@xxxxxxxxxxxxx>
Cc: Paul Durrant <paul@xxxxxxx>
Signed-off-by: Sean Christopherson <seanjc@xxxxxxxxxx>
  virt/kvm/pfncache.c | 16 +++++++++-------
  1 file changed, 9 insertions(+), 7 deletions(-)

Reviewed-by: Paul Durrant <paul@xxxxxxx>

[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