mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 03:15:31 +09:00
UPSTREAM: 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
(cherry picked from commit 2ec02f6c64)
Bug: 204960018
Signed-off-by: Will Deacon <willdeacon@google.com>
Change-Id: I859d3e9e702b84579e67f2e0e0b8e13e0759b921
This commit is contained in:
committed by
Will Deacon
parent
b75f76a88d
commit
3f1fe7fc1e
@@ -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