KVM: arm64: vgic-v3: Check ITS region is not above the VM IPA size
authorRicardo Koller <ricarkol@google.com>
Tue, 5 Oct 2021 01:19:14 +0000 (18:19 -0700)
committerMarc Zyngier <maz@kernel.org>
Mon, 11 Oct 2021 08:31:42 +0000 (09:31 +0100)
commit2ec02f6c64f043a249850c835ca7975c3a155d8b
treecae71cd969d0cacb50cbcd1d8410379c7893ca56
parentc56a87da0a7fa14180082249ac954c7ebc9e74e1
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
arch/arm64/kvm/vgic/vgic-its.c