Commit 42319f7a authored by Ricardo Koller's avatar Ricardo Koller Committed by Will Deacon
Browse files

UPSTREAM: KVM: arm64: vgic-v2: Check cpu interface region is not above the VM IPA size



Verify that the GICv2 CPU interface does not extend beyond the
VM-specified IPA range (phys_size).

  base + size > phys_size AND base < phys_size

Add the missing check into kvm_vgic_addr() which is called when setting
the region. This patch also enables some superfluous checks for the
distributor (vgic_check_ioaddr was enough as alignment == size for the
distributors).

Reviewed-by: default avatarEric Auger <eric.auger@redhat.com>
Signed-off-by: default avatarRicardo Koller <ricarkol@google.com>
Signed-off-by: default avatarMarc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20211005011921.437353-4-ricarkol@google.com


(cherry picked from commit c56a87da)
Bug: 204960018
Signed-off-by: default avatarWill Deacon <willdeacon@google.com>
Change-Id: Ib462da73c1f819152ee799507f037126db02ebbe
parent de006431
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment