mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-09 04:21:03 -04:00
KVM: arm64: vgic-v3: Check ITS region is not above the VM IPA size
Verify that the ITS region does not extend beyond the VM-specified IPA range (phys_size). base + size > phys_size AND base < phys_size Add the missing check into vgic_its_set_attr() which is called when setting the region. Reviewed-by: Eric Auger <eric.auger@redhat.com> Signed-off-by: Ricardo Koller <ricarkol@google.com> Signed-off-by: Marc Zyngier <maz@kernel.org> Link: https://lore.kernel.org/r/20211005011921.437353-5-ricarkol@google.com
This commit is contained in:
committed by
Marc Zyngier
parent
c56a87da0a
commit
2ec02f6c64
@@ -2710,8 +2710,8 @@ static int vgic_its_set_attr(struct kvm_device *dev,
|
||||
if (copy_from_user(&addr, uaddr, sizeof(addr)))
|
||||
return -EFAULT;
|
||||
|
||||
ret = vgic_check_ioaddr(dev->kvm, &its->vgic_its_base,
|
||||
addr, SZ_64K);
|
||||
ret = vgic_check_iorange(dev->kvm, its->vgic_its_base,
|
||||
addr, SZ_64K, KVM_VGIC_V3_ITS_SIZE);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user